community
cancel
Showing results for 
Search instead for 
Did you mean: 

Alteryx designer Discussions

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

Date Formatting

Atom

Dear Alteryx Experts,

 

I am looking for your help as I am having an dataset where in the date format is not correct. With help of date time tool I am able to resolve for one date error but the other date format is not proper which is giving me error.

 

Is there a way to resolve as below are my two formats in one file

 

as you can see the below first date is not in proper format and the second date is correct and I am able to convert it in DD/MM/YYYY format.

 

 

9/7/2018
24-07-2018
 

 

Please give me solution for resolving the error. Appreciate some quick reply as I need to finish this workflow as soon as possible

 

Regards

Ruchir

 

Alteryx Certified Partner
Alteryx Certified Partner

@ruchir04

 

How about:

 

DateTimeParse(replacechar([Date Field],"/",'-'),"%d-%m-%Y")

Cheers,

 

Mark

Alteryx ACE & Top Community Contributor

Chaos reigns within. Repent, reflect and reboot. Order shall return.
Atom

Hi,

 

How can I change the format of both the dates and convert it to common date format.

 

I want both the date format to DD/MM/YYYY.

 

Regards

Ruchir

Highlighted
Alteryx Certified Partner
Alteryx Certified Partner
These will be strings on output. Dates must be YYYY-MM-DD.

DateTimeFormat(DateTimeParse(replacechar([Date Field],"/",'-'),"%d-%m-%Y"),"%d/%m/%Y")

Cheers,

Mark
Alteryx ACE & Top Community Contributor

Chaos reigns within. Repent, reflect and reboot. Order shall return.
Atom

This won't work for incorrect data date format like for example 13-07-2018 I am able to convert from your formula to 19/07/2018 but I have some dates which are having an issue as they are not in proper format is there a way to convert them in a proper date format like 12/7/2018 as this is not getting converted.

 

Is there a way to figure out and apply formula and get it converted in DD/MM/YYYY format. Please let me know in case there is a solution available for resolving the date format for both date inputs else I would need to reach out to the person for providing me output in proper date readable format.

 

Thanks & looking forward for your quick help as always.

 

 

Labels