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.

Help need in IF / ELSE statement

AgiGovind
6 - Meteoroid

Hi Community,

 

i was trying to use IF ELSE for SLA date (Red, Amber, Green).

IF [SLA] = todate (datetimeadd (datetimetoday(),1, "days")) THEN "Green"
ELSEIF [SLA] = datetimetoday() THEN "Amber"
ELSEIF [SLA] < datetimetoday() THEN "Red"
ELSE "Others"
ENDIF
 
Example: if today is Friday (Amber) and my next SLA is Monday, Then Monday should fall under "Green"
But with above mentioned IF ELSE statement, Monday falls under "Others" (because it consider weekends)
Pls help, my logic should be : it should not consider weekends.  SLA dates are from Monday to Friday. 
Kindly advise how to modify the above statement.
Thank you! 
1 REPLY 1
dYoast
11 - Bolide

The simplest thing to do would be to just check if SLA is greater than today.

    IF [SLA] > datetimetoday() THEN 'Green"

This would cover the cases of Friday, Saturday and Sunday.

 

Otherwise, you will have to check if today is Friday, Saturday or Sunday and adjust your datetimeadd accordingly.

Labels
Top Solution Authors