We are celebrating the 10-year anniversary of the Alteryx Community! Learn more and join in on the fun here.
Start Free Trial

Alteryx Designer Desktop Discussions

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

Multi-Conditional ELSEIF statement

AgiGovind
6 - Meteoroid

Hello Everyone,  

Could you please help with my ELSEIF statement to make a new column in the data set.  I believe that most of it is structured correctly; however, when I start to close out the statement with ENDIF my formula goes from a colorful to black.

 

Below is my IF condition:

1. IF SLA date is equal to today then "Amber"

2. IF SLA date is less than today then "Red"

3. IF SLA date is equal to today + 1 then "Green"

4. IF SLA date is greater than today +1 then "White"

 

Formula:

IF [SLA date] = datetimetoday() +1 THEN "GREEN"
ELSEIF [SLA date] = datetimetoday() THEN "AMBER"
ELSEIF [SLA date] < datetimetoday() THEN "RED"

ELSEIF [SLA date] > datetimetoday() +1 THEN "WHITE"

ENDIF

 

Thanks in advance! 

3 REPLIES 3
apathetichell
20 - Arcturus

You need a base clause - ie a vanilla ELSE statement. You should add a base value.

 

I would also use datetimeadd(datetimetoday(),1,'days') vs datetimetoday()+1 --- but that might be just my preference.

Qiu
21 - Polaris
21 - Polaris

@AgiGovind 
Same as comment from above with some sample.

0505-Agi007.jpg

AgiGovind
6 - Meteoroid

Thank you Qiu and apathetichell 

Labels
Top Solution Authors