We are celebrating the 10-year anniversary of the Alteryx Community! Learn more and join in on the fun here.
Start Free Trial

Alteryx Designer Desktop Discussions

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

Converting Different Format Dates in a single Column to "dd-mm-YYYY" format

Tej_Singh
8 - Asteroid

Hi All,

 

I wish to convert different format of dates and strings in one column to "dd-mm-YYYY" string format . Is there a way we can handle this in Alteryx Designer? E.g. shown below as well as uploaded

 

 

DateReq Format
4/6/201506-04-2015
11/9/201509-11-2015
1/2/201601-02-2016
28/03/201628-03-2016
31-07-201731-07-2017
3 REPLIES 3
IraWatt
17 - Castor
17 - Castor

Hey @Tej_Singh,

The simplest way to do this without formulas is to use the DateTime tool like this:

Gif.gif

Essentially the first tool converts your text dates to a date data type and then the second tool reformats that date to your desired output.

 

Any questions or issues please ask :)
HTH!
Ira

 

 

grazitti_sapna
17 - Castor

@Tej_Singh, here is an another way of solving this.

grazitti_sapna_0-1658396373223.png

Formula: if REGEX_Match(Date,"\d+/\d+/\d+") then DateTimeFormat(DateTimeParse(Date,"%d/%m/%Y")
,"%d-%m-%Y")
elseif REGEX_Match(Date,"\d+-\d+-\d+")
then [Date]
else Null() endif

 

I hope this helps!

 

Thanks!

 

Sapna Gupta
Emmanuel_G
13 - Pulsar

Hi @Tej_Singh ,

 

One way to do this with formula tool

Emmanuel_G_0-1658396740994.png

 

Labels
Top Solution Authors