Alteryx Designer Desktop Discussions

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

convert to only month and year from string

adarsh2608
8 - Asteroid

I have a number which is in 202201 how can i  convert to date format ( year and month 2022-01 )

2 REPLIES 2
binuacs
20 - Arcturus

@adarsh2608 this can be done by using the datetime functions

binuacs_0-1649777870070.png

 

alexm06
8 - Asteroid

Hi adarsh2608,

 

As long as the date is always in the format yyyymm you could use Left and Right functions in a Formula tool to add a "-" to separate the year and month before using the DateTime tool to convert the field type to DateTime. 

I've attached an example workflow.

Does that solve your problem?

Labels