I am trying to perform 2 transformations of values in a field and one of which will be conditional.
IF [TAIL]="E-KAI" THEN "EFXF" ELSEIF [TAIL]="C-FXY" THEN "N6FE" ELSE [TAIL] ENDIF ReplaceChar([TAIL],'-','')
Unlike other programming languages, I am unable to insert the ReplaceChar function for all conditions neither is there an option to submit multiple expressions for column in the same Formula tool. I am finding that I have use multiple iterations in Alteryx compared to what I can do in Excel VBA script or SQL script in MS Access.
Any help here ?
Solved! Go to Solution.
I think you want something like:
ReplaceChar( SWITCH([TAIL], [TAIL], // Default value "E-KAI","EFXF", // IF E-KAY ==> EFXF "C-FXY","N6FE") // IF C-FXY ==> N6FE ,'-','')
Formulas in Alteryx are more like formulas in Excel than programming statements.
I may be misunderstanding what you are trying to achieve, but couldn't you just add the ReplaceChar function to the else? like so:
IF [TAIL]="E-KAI" THEN "EFXF"
ELSEIF [TAIL]="C-FXY" THEN "N6FE"
ELSE ReplaceChar([TAIL],'-','')
ENDIF
jkunderley79's solution worked elegantly.
@MSalvage - Your suggestion might work too that I can try.