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

Multiple IF Statements (IFS)

AuditPro13
8 - Asteroid

If someone could please tell me how I can get this to work it would be greatly appreciated. Thanks in advance!

 

IF
[DateTime_Out] >= "04-01-2018" AND [DateTime_Out] <= "03-31-2019" THEN "2018" ELSEIF

[DateTime_Out] >= "04-01-2019" AND [DateTime_Out] <= "03-31-2020" THEN "2019" ELSEIF

[DateTime_Out] >= "04-01-2020" AND [DateTime_Out] <= "03-31-2021" THEN "2020" ELSE
"ERROR"
ENDIF

3 REPLIES 3
cplewis90
13 - Pulsar
13 - Pulsar

Hey @AuditPro13,

 

If your field is a date coming through the workflow the data type should be in the format of YYYY-MM-DD so the formula would look like this:

 

IF
[DateTime_Out] >= '2018-04-01' AND [DateTime_Out] <= '2019-03-31' THEN "2018" ELSEIF

[DateTime_Out] >= '2019-04-01' AND [DateTime_Out] <= '2020-03-31' THEN "2019" ELSEIF

[DateTime_Out] >= '2020-04-01' AND [DateTime_Out] <= '2021-03-31' THEN "2020" ELSE
"ERROR"
ENDIF

AuditPro13
8 - Asteroid

This works! Thanks!

calldk50
5 - Atom

My Question-

If col1 != ' ' and col2 != ' ' and col3 != ' ' and col4 != ' ' and col5 != ' ' then 'completed'

elseif  col1 != ' ' and col2 != ' ' and col3 = ' ' and col4 = ' ' and col5 = ' ' then 'completed with 1 & 2'

elseif  col1 != ' ' and col2 != ' ' and col3 != ' ' and col4 = ' ' and col5 = ' ' then 'completed with 1 & 2 & 3'

elseif  col1 != ' ' and col2 != ' ' and col3 != ' ' and col4 != ' ' and col5 = ' ' then 'completed with 1 & 2 & 3 & 4'

else 'not completed'

 

Please help! Thanks in advance.

Labels
Top Solution Authors