Free Trial

Alteryx Designer Desktop Discussions

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

Multiple dates in String format need changing to DateTime

arundaka02
8 - Asteroid

Hi everyone

 

Please can someone help - I need the following dates in string format changing to DateTime format. 

 

I'm finding the DateTime tool great if the data follows one particular format, but when there is multiple in one column, it's poor. I've tried adding another DateTime tool after but the results go into a another column. 

 

Has the possibility of adding multiple rules capability into the DateTime tool?

 

Many thanks

KA

3 REPLIES 3
atcodedog05
22 - Nova
22 - Nova

Hi @arundaka02 

 

Here is a workflow for the task. Use this formula.

IF !IsNull(DateTimeParse([Date Published],"%d/%m/%Y")) THEN DateTimeParse([Date Published],"%d/%m/%Y")
ELSEIF !IsNull(DateTimeParse([Date Published],"%Y-%m-%d")) 
THEN DateTimeParse([Date Published],"%Y-%m-%d")
ELSE Null() ENDIF

Output:

atcodedog05_0-1602528282164.png

Workflow:

atcodedog05_1-1602528296277.png

If a date format currently doesnt exit it will give Null(). 

Identify and add more elseif statements if you have more date formats. 

 

Hope this helps 🙂

 

If this post helps you please mark it as solution. And give a like if you dont mind 😀👍

 

TheOC
15 - Aurora
15 - Aurora

Hey @arundaka02 

I managed this with a regex check within the formula tool. The same logic can be repeated to add more variants if needed. 

TheOC_0-1602528956592.png

 



Give me a shout if i can help any futher!



Bulien
atcodedog05
22 - Nova
22 - Nova

Hi @arundaka02 

 

Can I get a feedback what was the issue with my solution. So that I can fix it and learn from it.

 

Your feedback will be appreciated 🙂

Labels
Top Solution Authors