Advent of Code is now back for a limited time only! Complete as many challenges as you can to earn those badges you may have missed in December. Learn more about how to participate 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

Agi007
5 - Atom

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
19 - Altair

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

@Agi007 
Same as comment from above with some sample.

0505-Agi007.jpg

Agi007
5 - Atom

Thank you Qiu and apathetichell 

Labels
Top Solution Authors