community
cancel
Showing results for 
Search instead for 
Did you mean: 

Alteryx designer Discussions

Find answers, ask questions, and share expertise about Alteryx Designer.
SOLVED

IIF Function with Multiple Contains

Highlighted
Asteroid

Hi,

 

I am trying to convert an SQL script into the Formula button, but can't seem to work. 

 

IIF ([Order Number] IN ('111','222','333'), "Parts","Non-parts".  For some reason it is not working.

 

Please advise.

Wayne

Alteryx Certified Partner
Alteryx Certified Partner

Hi @yzhang316 

 

You have a missing parenthesis in your formula:

IIF ([Order Number] IN ('111','222','333'), "Parts","Non-parts")

 

Also, is Order Number an Int Type or String Type?

 

If it is an Int, the formula should look like this: IIF ([Order Number] IN (111,222,333), "Parts","Non-parts")

 

You shouldn't quote what's inside if it's a number.

 

Cheers,

Asteroid

Thank you!

Labels