Parse for Date
- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Mute
- Printer Friendly Page
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Notify Moderator
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
Solved! Go to Solution.
- Labels:
- Parse
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Notify Moderator
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.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Notify Moderator
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
