Free Trial

Alteryx Designer Desktop Discussions

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

Why will my And/Or statement not work

nickrosen28
7 - Meteor

Hi everyone,

 

I have an and or statement that looks at one column, and then once it spots "flagship" it look for any of the following "or's"

 

nickrosen28_1-1686946770126.png

I am at a loss trying to get it to work.

Any help would be appreciated(:

13 REPLIES 13
Dina
9 - Comet

I would recommend add "(" after the "and". 

alexnajm
17 - Castor
17 - Castor

You have an extra ending parentheses after "Flagship Allowed"! So either delete that parentheses or add an extra one earlier on in your formula

nickrosen28
7 - Meteor

Thanks for the quick reply!

 

I get this: It was this before so i added the extra one and it got me to the previous picture.

nickrosen28_0-1686948506487.png

 

nickrosen28
7 - Meteor

nickrosen28_0-1686948681967.png

Brings me back to this:(

alexnajm
17 - Castor
17 - Castor

Oh, you can’t list out multiple words in a contains statement. So you’ll either have to separate them out or use maybe NOT IN instead. 

if you copy paste the formula here, we can help more directly

nickrosen28
7 - Meteor

Direct formula:

 

f contains([Lounge Type],"Flagship")
and ! Contains([FFP Tier], "Sapphire", "Emerald")

or ! Contains([Tier], "ex-platinum", "Platinum",
"platinum pro", "conciergekey")

or ! contains([Flagaship Allowed?], "Flagship Allowed")

then "x" else "" endif

nickrosen28
7 - Meteor

Just posted it

alexnajm
17 - Castor
17 - Castor

IF contains([Lounge Type],"Flagship")
and !Contains([FFP Tier], "Sapphire")

or !Contains([FFP Tier], "Emerald")

or !Contains([Tier], "ex-platinum")

or !Contains([Tier], "Platinum")

or !Contains([Tier], "platinum pro")

or !Contains([Tier], "conciergekey")

or ! contains([Flagaship Allowed?], "Flagship Allowed")

then "x" else "" endif

alexnajm
17 - Castor
17 - Castor

This Formula should at least get rid of the red underline - I don't know if it will accomplish what you want though. For example, you might be better off using AND

 

IF contains([Lounge Type],"Flagship")
and !Contains([FFP Tier], "Sapphire")

and !Contains([FFP Tier], "Emerald")

and !Contains([Tier], "ex-platinum")

and !Contains([Tier], "Platinum")

and !Contains([Tier], "platinum pro")

and !Contains([Tier], "conciergekey")

and ! contains([Flagaship Allowed?], "Flagship Allowed")

then "x" else "" endif

Labels
Top Solution Authors