Free Trial

Alteryx Designer Desktop Discussions

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

Parse the date between the spaces and convert to date format using formula tool

phajiyev
5 - Atom

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?

4 REPLIES 4
DavidP
17 - Castor
17 - Castor

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!

binuacs
21 - Polaris

@phajiyev You can achieve this with the help of Formula tool or the DateTime tool

binuacs_0-1651241891374.pngbinuacs_1-1651241914906.png

 

messi007
15 - Aurora
15 - Aurora

@phajiyev,

 

Please see below : 

 

messi007_0-1651242253061.png

 

Attached the workflow,

Regards,

LogoPrime.png

DavidP
17 - Castor
17 - Castor

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.

Labels
Top Solution Authors