I am trying to assign a value for Column4 based on the grid below for the 3 columns, there are approximately 30 combinations(and growing).
I am trying to assign the value using Formula calc (IF ([Column3]=Null() AND [Column2]="B" AND [Column1]="C") then "D" ENDIF) but want to see if there is a better way of doing this other than a large IF function in alteryx- something similar to list comprehension in python.
| Column1 | Column2 | Column3 |
| A | B | C |
| D | E | F |
| D | B | C |
| F | E | A |
| C | D | B |
| A | ||
| C | B | |
| E | F | A |
Solved! Go to Solution.
Hi @kshah23
If there are many conditionals and no straight forward logic, you would need to write it like this.
An alternative is to have a reference input with the logic and use a join to bring in the information for Column 4. I added an example below.
In this example, the bottom input is a reference list that if the data from Column 1, 2 and 3 are the same, then it will bring the info on Column 4. I used the logic you mentioned ((IF ([Column3]=Null() AND [Column2]="B" AND [Column1]="C") then "D" ENDIF)). I use the Join to match all 3 columns, so the same concept as a IF function would, but this way you do not need to write a bunch of IF, you can have it in a table format which is a lot easier to create.
Pedro.
Thank you Pedro. That did it.
