Alteryx Designer Desktop Discussions

Find answers, ask questions, and share expertise about Alteryx Designer Desktop and Intelligence Suite.
SOLVED

Variables in Workflow

vasanthan
6 - Meteoroid

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?

4 REPLIES 4
RodL
Alteryx Alumni (Retired)

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.

Append date.png

 

RodL
Alteryx Alumni (Retired)

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).

MarqueeCrew
20 - Arcturus
20 - Arcturus

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.

Alteryx ACE & Top Community Contributor

Chaos reigns within. Repent, reflect and restart. Order shall return.
Please Subscribe to my youTube channel.
s_pichaipillai
12 - Quasar

Vasanth 

Try this one.

1. grab the first row which has the date

2. skip the first row and grab the data ONLY

3.add the date to the valid rows

 

let me know if you need any help

Labels