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.
SOLVED

Syntax for IF AND

ahsansalik
8 - Asteroid

Hi i am having a syntax error issue

 

IF [ Power] ='AC Fail' AND [RCA1] = 'Power Loss'
Then 'AC Fail Power Loss'
and if [Power]= 'AC Fail' AND [RCA1]= 'Other' Then 'AC Fail Other'
and if [ Power]='AC Fail' AND [RCA1]= 'Environmental - Weather / Storm' Then 'AC Fail Environmental - Weather / Storm'
ELSE Null()
ENDIF

 

ahsansalik_0-1624545798283.png

 

2 REPLIES 2
Maskell_Rascal
13 - Pulsar

Hi @ahsansalik 

 

Change your "and if" to ELSEIF. That should make the formula work as expected. 

IF [Power] ='AC Fail' AND [RCA1] = 'Power Loss'
THEN 'AC Fail Power Loss'
ELSEIF [Power]= 'AC Fail' AND [RCA1]= 'Other' 
THEN 'AC Fail Other'
ELSEIF [Power]='AC Fail' AND [RCA1]= 'Environmental - Weather / Storm' 
THEN 'AC Fail Environmental - Weather / Storm'
ELSE Null()
ENDIF

 

Cheers!

Phil

ahsansalik
8 - Asteroid

Thanks Phil 🙂

Labels
Top Solution Authors