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
Date | Req Format |
4/6/2015 | 06-04-2015 |
11/9/2015 | 09-11-2015 |
1/2/2016 | 01-02-2016 |
28/03/2016 | 28-03-2016 |
31-07-2017 | 31-07-2017 |
Hey @Tej_Singh,
The simplest way to do this without formulas is to use the DateTime tool like this:
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
@Tej_Singh, here is an another way of solving this.
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!