Bring your best ideas to the AI Use Case Contest! Enter to win 40 hours of expert engineering support and bring your vision to life using the powerful combination of Alteryx + AI. Learn more now, or go straight to the submission form.
Start Free Trial

Alteryx Designer Desktop Discussions

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

Change date format "1202001" to "2001-01-20"

Nagaraju_kanna
8 - Asteroid

How do I convert "1202001" to "2001-01-20" string type? I have used the below specified function to change the date format but I am getting Null. Could someone help.

 

DateTimeParse([XXXXX],"%m%d%Y").

 

Input date format --> 1202001

 

Output date format --> 2001-01-20

 

 

4 REPLIES 4
atcodedog05
22 - Nova
22 - Nova

_

AngelosPachis
16 - Nebula

Hi @Nagaraju_kanna ,

 

Saw @atcodedog05  solutions and realised I missed something. Indeed you are missing a zero at the beginning of your field, so maybe you can try to padleft your input field so you get that 0 at the beginning and then you can parse the date field

 

AngelosPachis_1-1632398003272.png

 

 

 

atcodedog05
22 - Nova
22 - Nova

Hi @Nagaraju_kanna 

 

My take on this.

 

Edit: Even I had few corrections so removed my previous post 😅

 

Workflow:

atcodedog05_0-1632398048523.png

 

Hope this helps : )

Maskell_Rascal
13 - Pulsar

@Nagaraju_kanna 

 

If you use @atcodedog05's solution in a Multi-Field Formula tool, you can convert the field type as well! You also have the added option of converting multiple date fields if needed. 

Maskell_Rascal_0-1632422789224.png

 

Cheers!

Phil

Labels
Top Solution Authors