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.
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
21 - Polaris

@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
Top Solution Authors