Let’s talk Alteryx Copilot. Join the live AMA event to connect with the Alteryx team, ask questions, and hear how others are exploring what Copilot can do. Have Copilot questions? Ask here!
Start Free Trial

Alteryx Designer Desktop Discussions

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

How do I create a shorter formula as a substitute for multiple ORs?

Adityasa
7 - Meteor

I need to write a formula where if [Column 1] has Apple, Banana, Cat, Dog, Elephant, Fish, Giraffe, Horse, India, Joker, Kite, Lemon, Mango, Nile, Orange, Parrot or Queen, AND [Column 2] has Rat, Staple, Truffle or University, the [Column 3] is updated to 'Check'. In every other condition [Column 3] should remain as is.

 

When I list the above items in Column 1 and Column 2, the data in Column 1 and Column 2 are exactly as mentioned and I don't mean it contains these words.

 

Currently I am using [Column 1]='Apple' OR [Column2]='Banana'.. and it is turning out to be a really long formula.

1 REPLY 1
AngelosPachis
16 - Nebula

Hi @Adityasa ,

 

You can use an In function which is like multiple or statements. Your expression would be something like

 

IF [Column 1] IN ("Apple","Banana","Cat",....,"Queen") AND [Column 2] IN ("Rat","Staple"...,"University") THEN "Check"
ELSE [Column 3]
ENDIF
Labels
Top Solution Authors