Join the Alteryx Community’s Maveryx Summer Cup event! Compete, network with others, and earn your gold through a series of challenges from July 24th to August 11th. Learn more about the event here.

Alteryx Designer Desktop Discussions

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

DateTime Conversions

nwatzlaf
8 - Asteroid

Hi there,

 

I have a last edited date column with days in the format 20180812 etc. I would like to change the format to 08-12-18 but the DateTime tool is giving me trouble. The type going in is V_String. I am getting NULL values for the output column.. 

 

Thanks!!

3 REPLIES 3
MichalM
Alteryx Alumni (Retired)

@nwatzlaf 

 

This would be a two-step process

 

1. You need to turn the string into a standard date (yyyy-mm-dd) - in this instance you're giving Alteryx the pattern the string is coming in

2. Once in the date format, you can parse it out as a string with the desired format 

 

Example attached

 

date-parse.png

estherb47
15 - Aurora
15 - Aurora

Hi @nwatzlaf 

 

The Date Time Tool should convert your string into a date format for Alteryx. So, if your input is 20180812, you'll need to use the custom format of yyyyMMdd (the capital Ms are needed). That should result in 2018-08-12

 

To convert it to the string format you want, use another Date Time tool, this time converting from date to string. using another custom code of MM-dd-yyyy

 

Basically, you're telling Alteryx what format your string is in, and then in the next tool, what format you'd like outputted.

 

Let me know if that works.

 

Cheers!

Esther

nwatzlaf
8 - Asteroid

I knew I was forgetting a step! Thanks so much for your help!!

Labels