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

Alteryx Designer Desktop Discussions

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

Multi IF Statement Issue in Alteryx

rjesus1987
5 - Atom

Hello,

 

I'm trying to create a multi IF statement in Alteryx however I'm getting an error "Parse Error at char(59): Malformed If Statement".  Below is how I set the formula:

 

if [Net Skill]==[Skill1] then "YES"
OR [Net Skill]==[Skill2] then "YES"
OR [Net Skill]==[Skill3] then "YES"
OR [Net Skill]==[Skill4] then "YES"
else "NO"
ENDIF

 

So basically, "NET SKILL" is the reference column and I want to do a validation between 4 other columns and will result to NO if it doesn't meet those 4 conditions (Skill1 to Skill4).

 

UPDATE:  Kindly disregard..  I've figured it out ^_^

 

Thanks in advance ^_^

2 REPLIES 2
KGT
11 - Bolide

Hi @rjesus1987 ,

 

Firstly, this is posted in General rather than Designer, which is probably why it took a bit to get a response.

 

To use the solution in the way you're after, with individual "Then" clauses, you would need an elseif for each evaluation. However, it's easier than that for this use case, the Then clause just comes after all the OR's as such:

 

If [Net Skill]==[Skill1]
OR [Net Skill]==[Skill2]
OR [Net Skill]==[Skill3]
OR [Net Skill]==[Skill4]
THEN "Yes"
else "NO"
ENDIF

 

And even easier:

If [Net Skill] IN ([Skill1],[Skill2],[Skill3],[Skill4])
THEN "Yes"
ELSE "No"
ENDIF

Raj
16 - Nebula

@rjesus1987 kindly close the conversation if solved.

Labels