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 / ELSEIF condition2 THEN true2 ELSE false ENDIF - Error with datetimenow

Tjillett
7 - Meteor

Have a little bit of a roadblock on one last piece. I relatively new to Alterxy and tried searching for an answer before posting.

Here's my error any help would be appreciated.

I have my no/ no working but believe there is an error in my Else IF. I need to have an output that shows datetimenow minus order date if greater than 3.

 

What am I missing...Thanks

 

IF [New Conf Date]='NO' THEN 'NO'
ELSEIF DateTimeNow() - [Order Date]>3 THEN 'Inprocess'
ELSE 'Maybe'
ENDIF

11 REPLIES 11
Tjillett
7 - Meteor

Thank You.. Works like a charm

JohnJPS
15 - Aurora

Sounds great.  Another tip to keep in mind is the IIF statement... the syntax is IIF(Condition , Value When True , Value When False )  ... this could be used to shrink your inner IF considerably:

 

IF DateTimeDiff(DateTimeNow(),[Need Date2],"days") > 0 THEN
   IIF(IsNull([Confirm-Date]),'YES','NO')
ELSE 
   'N/A'
ENDIF

... or even both IF's, though it becomes less read-able then:

 

IIF(DateTimeDiff(DateTimeNow(),[Need Date2],"days") > 0,
    IIF(IsNull([Confirm-Date]),'YES','NO'),'N/A')

 Happy blending!

Labels
Top Solution Authors