Upgrading Server to version 22.1? We’ve enabled the faster AMP engine by default. Read about how these system settings changes might affect you.

We’re aware of an intermittent issue with our My Alteryx login and are actively working to have the issue corrected. If you run into an error when logging in, please try clearing all cookies or accessing the community on a different browser. Thank you for your patience!

Dev Space

Customize and extend the power of Alteryx with SDKs, APIs, custom tools, and more.

If else error

AS
8 - Asteroid

IF [Account2]= 662321 THEN "S"
ELSEIF [Account2] = 63243 THEN "R"
ELSEIF [Account2] = 612323 THEN "D"
ELSEIF [Account2] = 723234 THEN "O"
ELSEIF [Account2] = 62323 or [Account2]= 614343130 THEN "I"
ELSEIF [Account2]= 503232 or
[Account2]= 50300 or [Account2]= 5024535 or [Account2]= 50436 or [Account2]= 503540 or [Account2]=54565530 or [Account2]=5113500 THEN "C"
ELSEIF [Account2]=6541030 THEN "Fee"
ELSE "None" ENDIF

 

I wrote the correct syntax but still getting error in this if else formula. I checked everything but could not understand why.

Could you please help.

3 REPLIES 3
binuacs
15 - Aurora

@AS your formula is correct, please check your [Account2] field is numeric data type? if not please use toNumber([Account2]) or change the data type to double

binuacs_0-1647412941743.png

 

AS
8 - Asteroid

Screenshot (5).png

 I'm getting error in the end. Please have a look

binuacs
15 - Aurora

@AS can you check your Account2 field data type and make sure that it is not string? I also updated your formula instead of multiple OR operator you can use the IN operator

 

IF [Account2]= 662321 THEN "S"
ELSEIF [Account2] = 63243 THEN "R"
ELSEIF [Account2] = 612323 THEN "D"
ELSEIF [Account2] = 723234 THEN "O"
ELSEIF [Account2] IN ( 62323, 614343130) THEN "I"
ELSEIF [Account2] IN( 503232, 50300 ,5024535 ,50436 ,503540 ,54565530 ,5113500) THEN "C"
ELSEIF [Account2]=6541030 THEN "Fee"
ELSE "None" ENDIF