Start Free Trial

Alteryx Designer Desktop Discussions

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

Conditional Date Time statement not working

VeronicaElse
8 - Asteroid

Hi, 

 

I have about a couple of records that should be NOT MET but they are ALL showing MET.

 

I have done a DATETIMEPARSE and still not working. Also, I would like to add something that will detect a blank date as also NOT MET. 

 

IF DateTimeParse([Deadline Date],'m%/%d/%Y %I:%M %p ' )< DateTimeParse([Completed Date],'m%/%d/%Y %I:%M %p ' ) THEN "MET" ELSE "NOT MET" ENDIF

 

Deadline Date         Completed Date

8/12/2022 4:30 PM    8/12/2022 4:45 PM
8/12/2022 4:30 PM    8/12/2022 4:38 PM
8/12/2022 12:00 PM  8/12/2022 11:45 AM
null                             8/10/2022 4:49 PM


Please HELP

 

thanks

2 REPLIES 2
OllieClarke
15 - Aurora
15 - Aurora

@VeronicaElse I think you've a typo - should be '%m' not 'm%' at the start
Something like:

If ISNULL([Deadline Date]) THEN 'NOT MET'
ELSEIF DATETIMEPARSE([Deadline Date],'%m/%d/%Y %I:%M: %p') < DATETIMEPARSE([Completed Date Date],'%m/%d/%Y %I:%M: %p') THEN 'MET'
ELSE 'NOT MET'
ENDIF

Hope that helps,

Ollie

IraWatt
17 - Castor
17 - Castor

Hey @VeronicaElse,

Looks like your formula is good, just got the %m in the datetimeparse the wrong way round, should be:

IF DateTimeParse([Deadline Date],'%m/%d/%Y %I:%M %p' )< DateTimeParse([Completed Date],'%m/%d/%y %I:%M %p ' ) THEN "MET" ELSE "NOT MET" ENDIF

IraWatt_0-1663092017599.png

Any questions or issues please ask

Ira Watt
Technical Consultant
Watt@Bulien.com 

 

Labels
Top Solution Authors