Formula Tool Question – Populating a column based on workflow data
- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Mute
- Printer Friendly Page
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Notify Moderator
Hello,
Hopefully this is an easy question. I am trying to populate a column within my workflow based on data from my input file. The column I need populated is called “Master Industry” and there are 2 criteria that determine which column of information (in my data set) is what needs to be populated.
Where the RFI Code (column E) is “F” then I need the “Shipper” (column F) to populate as the Master Industry (column D). (If I were doing this manually in excel, I would simply copy the content of column F into column D for that row.)
Where the RFI code is “R” I need the “Care Of” to populate as the Master Industry if there is a value within this field. If there is no value within the “Care Of” field then I need the “Consignee” (Column H) to populate as the Master Industry.
In my mind, there should be a way to do this within the formula tool, but I haven’t been able to determine the exact statement to get this to work.
Hopefully below communicates what I am thinking.
Attached is my Alteryx workflow and my input data file. Below shows the Alteryx tools I am trying to utilize in this simple test.
Below shows my input data.
Below shows my desired output.
Thanks in advance!
Solved! Go to Solution.
- Labels:
- Common Use Cases
- Developer
- Input
- Output
- Workflow
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Notify Moderator
Hi @AverySimecka ,
If statements in Alteryx are formed as:
IF condition1 then statement 1
ELSEIF condition2 then statement2
.
.
ELSE statementN
ENDIF
In your occasion, I would try:
IF [RFI Code]="F" THEN [Shipper]
ELSEIF [RFI Code]="R" AND !ISEMPTY([Care Of]) THEN [Care Of]
ELSEIF ISEMPTY([Care Of]) THEN [Consignee]
ELSE NULL()
ENDIF
I would also add a select tool before your formula tool and change the data type for the column Master industry to a V_String as well.
Let me know if that works for you.
Cheers,
Angelos
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Notify Moderator
Angelos - that worked! I appreciate your help.
