Community Spring Cleaning week is here! Join your fellow Maveryx in digging through your old posts and marking comments on them as solved. Learn more here!

Alteryx Designer Desktop Discussions

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

Need Help with Date/Time Parsing in AM/PM Format

ddiesel
13 - Pulsar
13 - Pulsar

Can someone help me with some date/time parsing? I have tried everything from BB Date to parsing with formulas to force a vstring into a date/time format. Specifically, I am having trouble with AM/PM part of the date. See attached workflow.

 

Thank you in advance!

8 REPLIES 8
JeffF
Alteryx
Alteryx

Here is an example that parses the AM/PM.  The key is to add 12 hours if it's PM.

matthew_slaughter
6 - Meteoroid

In expression 2 of your formula tool, you need another condition to check if the hour is 12 and meridiem is PM.  In that case, add 0 hours.

JeffF
Alteryx
Alteryx

Yes, and also check if it's 12AM and subtract 12 hours.

 

Here is the fixed workflow.

ddiesel
13 - Pulsar
13 - Pulsar

As an Alteryx newbie, this parsing was a little over my head. Now that I see your solution, it makes sense! This was the last piece I needed to get my workflow working as envisioned. THANK YOU so much for this solution!

ddiesel
13 - Pulsar
13 - Pulsar

Thank you, Matthew!

JeffF
Alteryx
Alteryx

I'm happy to help!  I noticed I switched the day and month when parsing the date/time with AM/PM.  It's parsing dd/mm/yyyy instead of mm/dd/yyyy (European style) so Oct. 7th is parsed as July 10th.  It's a simple fix I'm sure you can handle, if you haven't already.

 

And thank you Matthew for pointing out those troublesome twelves.

matthew_slaughter
6 - Meteoroid

You're most welcome.  I am hoping that the next version of Alteryx has an improved Date/Time parsing or interpretation functions.

Gomes
8 - Asteroid

See my solution.

Labels