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.

Multi IF Statement Issue in Alteryx

rjesus1987
6 - Meteoroid

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
13 - Pulsar

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
Top Solution Authors