Alteryx Designer Desktop Discussions

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

Parse for Date

pvara
8 - Asteroid

I am trying to parse this file name, the resulting data I am looking to capture is Apr 2018. Ultimately I will convert it to YYYYMM. 

 

GL Recon Apr 2018 Direct Sales + Adj.xlsx

2 REPLIES 2
CharlieS
17 - Castor
17 - Castor

Hi @pvara 

 

There are generally two steps to this process:

1. Parse/Convert from "Apr 2018" to the standard date format (ISO 8601), which is YYYY-MM-DD so Alteryx can perform DateTime functions on that value.

2. Format this date value into the output format you prefer.

 

Here are the expressions for each, where [Input] is the field with "Apr 2018".

1. DateTimeParse([Input],"%b %y")

2. DateTimeFormat([ResultFromAbove],"%Y%m")

 

Now we can combine both of the calculations into one expression:

DateTimeFormat(DateTimeParse([Input],"%b %y"),"%Y%m")

 

Use that in a Formula tool and that's it. Check out the attached example and let me know if you have any questions.

CharlieS
17 - Castor
17 - Castor

For future reference, here's the documentation page on the Date Time functions including all the specifiers:

 

https://help.alteryx.com/current/Reference/Functions.htm#Date/Time 

Labels