Advent of Code is back! Unwrap daily challenges to sharpen your Alteryx skills and earn badges along the way! Learn more now.
Free Trial

Alteryx Designer Desktop Discussions

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

IIF OR FORMULA WITH CONTAINS

insomned
8 - Asteroid

Based on a certain criteria, I need to create another column, which would output "YES" or "NO". 

 

I want "YES" as an output for the column, which contains a specific word (let's say "HELLO") and (OR in the Alteryx terms) I want "YES" for the column where the names equal to "Adam", "Steve", etc (that's a different column from where I have "HELLO"). 

 

So that would be an if formula with both contains and equals, I believe!

 

Any help would be much appreciated, thank you! 

3 REPLIES 3
Luke_C
17 - Castor
17 - Castor

Hi @insomned 

 

Substitute your column names, but here's an example:

 

IF Contains([Field 1],'HELLO') OR [Field 2] in ('Adam','Steve')

Then 'YES'

Else 'NO'

Endif

 

Luke_C_0-1631643845002.png

 

Maskell_Rascal
13 - Pulsar

Hi @insomned 

 

Here is how you can do it. 

 

IIF(Contains([Field1], 'HELLO') AND [Field2] IN ('Steve','Adam'),'YES','NO')

 

I'm using a contains to find "HELLO" in one field and an IN function to match a field to a small list of names. 

 

Maskell_Rascal_0-1631643805220.png

 

Hope this helps. 

 

Cheers!

Phil

 

Qiu
21 - Polaris
21 - Polaris

@insomned 
I think we should make it more flexible.

Your second creteria seems not to be fixed therefore we should have a text input for easy maitenance.

0915-insomned.PNG

Labels
Top Solution Authors