I have an input data with the columns: (Data1) (file name: data set)
Serial No. | age | work class | Salary PA | education | marital-status | occupation | gender | hours-per-week | native-country |
I have separate data sheet for the conditions to be applied on the above data: (Data2) (filename : Rules)
Rule Serial No | age lower limit | age upper limit | Salary Lower Limit | Salary Upper Limit | Gender | Class |
Problem:
The Age, Salary PA & Gender (Data1) are the focus columns on which the data need be segregated and the Class(data2) would be appended to the Data1 as a new column.
The Conditions data (Data2) needs to be fed dynamically to the IF ELSE statements, since the conditions change periodically. (can't be hardcoded)
Conditions need to be compared with a FOR Loop, and the CLASS value to be set/defined for each row of the Data1.
Example:
The final data should give an output as:
age | work class | Salary PA | education | marital-status | occupation | gender | hours-per-week | native-country | Class (from Data2) |
Below i have written a code in a made-up language. treat this as a logic:
Can this be automated in Alteryx? refer attachments for Data.
Solved! Go to Solution.
Hi @Debapriya,
if you want to do this in Alteryx, you will not need an iterative macro to do so. In your case, you can use a 2 steps method to do so :
Tell me if it's not clear,
Arthur
Thank you so much.