Alteryx Designer Desktop Discussions

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

Help Parsing out a date formatted Apr 23, 2019, 3:29 PM to YYYY-MM-DD

ijohnson
7 - Meteor

I'm wondering what the easiest solution would be to parse out the date below to result in YYYY-MM-DD

 

Apr 23, 2019, 3:29 PM

 

The output I would like would be 2019-04-23

 

Thanks!!

 

Ian

4 REPLIES 4
ijohnson
7 - Meteor

So I figured out a work around:

 

1. used the formula tool to parse out:

 

Month: Left([Transaction Date], 3)     -- Result Apr

Day: Substring([Transaction Date],4,2)   --- Result 24

Year: Substring([Transaction Date],8,4)  --- Result 2019

 

2. Created a crosswalk in excel for the month:

 

Jan - 01

Feb - 02

Mar - 03

Apr - 04

 

3. Joined the Month string (Apr) to the crosswalk to return the number value for the month, Apr = 04

 

4. Concatenated all the fields back into one 

[Year]+'-'+[Month]+'-'+[Day]

 

I don't know if that was the easiest solution but it got the job done.

 

 

bpatel
Alteryx
Alteryx

You could also use the datetime tool. I hope this helps!

 

 DateTimeParse.PNG

CharlieS
17 - Castor
17 - Castor

You can parse that using this expression in a Formula tool:

 

DateTimeParse([Input],"%b %d, %Y")

 

Where "Apr 23, 2019, 3:29 PM" is in the {Input] field.

ijohnson
7 - Meteor

Oh lord, I feel pretty stupid. 

Labels