Community Spring Cleaning week is here! Join your fellow Maveryx in digging through your old posts and marking comments on them as solved. Learn more here!

Alteryx Designer Desktop Discussions

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

How to convert different date formats to the same one in a column?

vvei
6 - Meteoroid

Hi,

 

How do i convert this column into mm/dd/yyyy format ? I was trying the custom format, but it left the yyyy-mm-dd ones unconverted. 

clipboard_image_0.png

 

Thanks! 

 

8 REPLIES 8
BrandonB
Alteryx
Alteryx

A quick way would be a filter tool where Contains([date],"/") and then use a date tool from the true with the one format and a date tool from the false with the other format, and then union both of them afterwards. This way you would standardize all dates to an actual date format. Then you could use another date tool at the end which converts a date format to the string format of your choice where you could specify mm/dd/yyyy as you would like. 

BrandonB
Alteryx
Alteryx

Example workflow is attached

 

Date formatting picture.png

RolandSchubert
16 - Nebula
16 - Nebula

Hi @vvei ,

 

you should use a formula tool and convert in a first step to a Date format using DateTimeParse depending on the seperator (IF "-" then "%Y-%m-%d" ELSE "%d/%m/%Y"). In a second step you can create the format you need using DateTimeFormat. See attached workflow.

In addition, there are some NULL values and strings in the column, I added a filter tool to eliminate.

 

Best regards

 

Roland

vvei
6 - Meteoroid

Thank you @BrandonB ! 

vvei
6 - Meteoroid

Thank you @RolandSchubert ! 

TerryT
Alteryx Alumni (Retired)

I am kinda partial to RegEx:

clipboard_image_0.png

NishNair
5 - Atom

This is helpful! Thank you!! 

vvei
6 - Meteoroid

This also works well! Thank you @TerryT 

Labels