General Discussions

Discuss any topics that are not product-specific here.

Multi IF Statement Issue in Alteryx

rjesus1987
Átomo

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 ^_^

1 RESPUESTA 1
KGT
Asteroide

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

Etiquetas