Bring your best ideas to the AI Use Case Contest! Enter to win 40 hours of expert engineering support and bring your vision to life using the powerful combination of Alteryx + AI. Learn more now, or go straight to the submission form.
Start Free Trial

Alteryx Designer Desktop Discussions

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

IIF Function with Multiple Contains

yzhang316
8 - 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

2 REPLIES 2
Thableaus
17 - Castor
17 - Castor

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,

yzhang316
8 - Asteroid

Thank you!

Labels
Top Solution Authors