Convert String format to Year and Month
- 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 looking to convert string format of "201201" to a Year and month format of "01-2012"
Any help would be greatly appreciated
Solved! Go to Solution.
- Labels:
- Date Time
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Notify Moderator
Hi @FECL3 I mocked up a workflow that produces the output you describe in a few different ways.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Notify Moderator
Thank you for the response. I want the output in a date format (mm-YYYY) however, when I change the output of the formula to date it does not run as expected. How would I correct this?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Notify Moderator
Hi @FECL3 Alteryx only recognises YYYY-MM-DD as a valid date format hence when you change the data type to data in formula tool it does not work. If you want the format mm-YYYY then it will need to be a string field like in the workflow I previously posted. This link explains in more detail Datetime Function in alteryx. If you read the section about Datetime Format it shows that the data types needs to be a string.
DateTimeFormat(dt,f): Converts date-time data from ISO format to another specified format (f) for use by another application. Output to a string data type.
