How can i write a IF statement that allows me to change Aliases for multiple items in a column A as output in Column B also that all of the below names are from Electrical and Mechanical Department
Department | Column A | Column B |
Electrical | Adrian | Adi |
Mechanical | Jack | Jackers |
Electrical | Shane | Sha |
Electrical | Jenny | Jeniffer |
Mechanical | Jade | Ja |
I have written a statement like this
IF [Department] ='Electrical' and [Column A] =' Adrian' then 'Adi' elseif [ Department ] = 'Electrical' and [Coloumn A] = ' Shane' and 'Sha' elseif [Department] ='Mechanical' and [Column A] = 'Jade' then 'Ja' else [NULL] endif
its not working somehow i am using the formula tool for this purpose
Solved! Go to Solution.
Hi @ahsansalik
Find and replace would be best approach for this. You can look up from a table and replace.
https://help.alteryx.com/20212/designer/find-replace-tool
Hope this helps : )
Hi @ahsansalik ,
If you copy pasted your formula then there is a typo :
IF [Department] ='Electrical' and [Column A] =' Adrian' then 'Adi' elseif [ Department ] = 'Electrical' and [Coloumn A] = ' Shane' THEN 'Sha' elseif [Department] ='Mechanical' and [Column A] = 'Jade' then 'Ja' else [NULL] endif
I replaced a "and" with "THEN".
Also, @atcodedog05's suggestion might be considered based on your need.
Hi @ahsansalik
You can do something like below. Best option if you have mutiple names. You can use join tool too. Just check which works best in your screanrio.
Hope this helps : )
And if you want to fix the same formula and get it working @Jean-Balteryx has suggested the fix for it. 🙂
I didnt look into the formula much directly went to the mapping approach 😅
Thanks Guys for your help as i learn new and new stuff from you all here 🙂
User | Count |
---|---|
18 | |
14 | |
13 | |
9 | |
8 |