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

IF Formula with Date condition

RanjanKT
8 - Asteroid

Hi,

 

Can some one help me correcting the below formula.

 

For some reason i am getting the out put only

Closed

Pastdue

>90

 

if [Stage]="Closed" then "Closed" elseif [AnticipatedWinDate]<"28-06-2019" then "Pastdue" elseif [AnticipatedWinDate]<=DateTimeAdd("2019-06-28",+30,"days") then "0-30" elseif [AnticipatedWinDate]<=DateTimeAdd("2019-06-28",+60,"days") then "31-60" elseif [AnticipatedWinDate]<=DateTimeAdd("2019-06-28",+90,"days") then "61-90" else ">90"
Endif

 

The date is in the below format

clipboard_image_0.png

1 REPLY 1
Thableaus
17 - Castor
17 - Castor
Hi,

Your First clause has a date out of date format. Correct the Format to yyyy-mm-dd

if [Stage]="Closed" then "Closed" elseif [AnticipatedWinDate]<"2019-06-28" then "Pastdue" elseif [AnticipatedWinDate]<=DateTimeAdd("2019-06-28",+30,"days") then "0-30" elseif [AnticipatedWinDate]<=DateTimeAdd("2019-06-28",+60,"days") then "31-60" elseif [AnticipatedWinDate]<=DateTimeAdd("2019-06-28",+90,"days") then "61-90" else ">90"
Endif
Labels
Top Solution Authors