I have a .csv file where first row indicates the valid date of the data in that file. Rest of the rows represent data.
I would like to import the data in a database table and add a new column called Effective Date and populate it with the date in the first row.
What's the best wat to approach this?
I was thinking to
(a) capture the date in the first row in a variable and
(b) use that to populate the new column Effective Date using Formula tool & Expression.
But, can't find anywhere on how to create a variable.
Is there another way of approaching this?
Solved! Go to Solution.
There may be other more elegant ways, but a simple approach is to use two Select Record tools. One selects only the first record; the other one selects everything beyond the first record.
After the first Select Records tool, add a Select and just select the field with your date, rename, and retype it.
Then use an Append Fields tool to combine them back.
Oh, and I meant to add...the way to create a variable is using the Formula tool. Just type in the name of the variable in the Output Field and then define your Expression below (which can actually be a constant value if needed).
Yes.
Capture that data element and you can APPEND FIELDS and put it onto every record. You can also set a global variable with the value and use it from there too.