Parse the date between the spaces and convert to date format using formula tool
- 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
Hi I have a date data like this "Thursday 01/04/2021 01:50:39" (without quotations) and I wanted to make sure that it is displayed like "01/04/2021" (without quotations) and converted to Date format. I have several columns with similar format, and in order to keep workflow simple, I am looking for a solution to achieve the desired result with a Formula tool. Can anyone help me with this?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Notify Moderator
Hi @phajiyev
You can achieve this with the DateTimeParse() function and you can learn all about datetime functions and formats here:
https://help.alteryx.com/20214/designer/datetime-functions
If you need to do this for multiple columns, I'd suggest using the Multi-Field Formula tool instead of the regular formula tool.
Playing around with these tools is a great way to learn so I would encourage you to do that rather than just copy the solution that someone is no doubt going to post in this thread!
Happy Alteryxing!
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Notify Moderator
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Notify Moderator
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Notify Moderator
There are also other fun things you can do with Text functions, for instance, if the Getword() function looks a your string, it would see 3 words (numbered 0,1,2) You can therefore extract the middle word from the string (which is the date part) using GetWord(string, 1)
If you then want to convert that to an Alteryx date format, the DatetimeParse() function becomes a little easier to implement.
