Alteryx Designer Desktop Discussions

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

Convert V_String to Date format

beatrizmguerreiro
8 - Asteroid

Hello, 

 

I need to change this column (type V_string) to Date format. I have checked other posts and tried to replicate solutions, like add formula tool or DateTime tool, but I end up with Null Values. How should I approach this situation?

 

Hereis an example of my dataset:

 

01/01/2019
04/01/2019
05/01/2019
08/01/2019
08/01/2019
09/01/2019
10/01/2019
10/01/2019

13 REPLIES 13
Emil_Kos
17 - Castor
17 - Castor

Hi @beatrizmguerreiro,

 

As it will be easier for you to manage and understand I used date time tool in order to do it:

 

Emil_Kos_0-1613554627837.png

 


I wasn't sure if the first two digits represent month or day as it wasn't clear from the example I have created two different versions for you.


If this was helpful please mark my post as a solution!

 

beatrizmguerreiro
8 - Asteroid

Hello @Emil_Kos 

 

The first 2 digits represent day.

 

i tried your solution and I got all Null values

beatrizmguerreiro_0-1613554827271.png

 

Emil_Kos
17 - Castor
17 - Castor

Hi @beatrizmguerreiro,

 

Are you sure the date time column refers to the correct column name?

 

Emil_Kos_1-1613554984310.png

 

Please check if your date is exactly in the format that you specified:

 

01/01/2019

 

My workflow works I just tested it.

 

Emil_Kos_0-1613554976068.png

 

Qiu
20 - Arcturus
20 - Arcturus

@beatrizmguerreiro 

A bit different approach with @Emil_Kos 

Capture45.PNG

beatrizmguerreiro
8 - Asteroid

We are almost there...

 

I got this warning messages 

beatrizmguerreiro_0-1613557720707.png

 

Emil_Kos
17 - Castor
17 - Castor

Hi @beatrizmguerreiro,

 

You get this error using my or @Qiu workflow?

grazitti_sapna
17 - Castor

@beatrizmguerreiro  can you possibly share the dataset you are using just for the dates column along with the sample workflow seems like there are some records with date and time as per the error.

Also if you see the error the date time format is in yyyy-mm-dd hh:mm:ss whereas the logic used is %d/%m/%Y for conversion.

Does your dataset include multiple date formats?

Thanks.

Sapna Gupta
Qiu
20 - Arcturus
20 - Arcturus

@beatrizmguerreiro @Emil_Kos 
I think both will not work since, his test data contains not only the date also the time.🤔

 

Emil_Kos
17 - Castor
17 - Castor

Hi @Qiu,


Really good point.

 

In that case, this should work for @beatrizmguerreiro :

DateTimeParse(Left([date], 10),'%d/%m/%Y')

 

I have used the left function in order to show only relevant values. 

Labels