Date - String to YYYYMM

Solved!
cb86
Level 1
Date - String to YYYYMM

Hello,

I have a date (YYYYMM) that is being read as a string. How can i convert/parse this date to be read as a date?

0 Kudos
1 Solution
Cรฉlian
Dataiker

"yyyy-MM" would parse dates with a '-' between the year and the month, for example "2021-01"

To parse "202101" you need to set the format to "yyyyMM" (without the '-')

View solution in original post

0 Kudos
5 Replies
Cรฉlian
Dataiker

Hello,

In a prepare recipe, you can use a Parse Date step to convert strings to date in the format you want.

Capture dโ€™eฬcran 2021-05-20 aฬ€ 16.15.20.png

0 Kudos
CoreyS
Dataiker Alumni

Hi @cb86 and welcome to the Dataiku Community. In addition to @Cรฉlian's excellent explanation I believe this thread should help as well: String dates to datetime format 

I hope this helps!

Looking for more resources to help you use Dataiku effectively and upskill your knowledge? Check out these great resources: Dataiku Academy | Documentation | Knowledge Base

A reply answered your question? Mark as โ€˜Accepted Solutionโ€™ to help others like you!
0 Kudos
cb86
Level 1
Author

Thank you both for your quick response. I tried to use the prepare recipe to parse the date. However, I am not seeing any results? I am doing it correctly (image attached)?

0 Kudos
Cรฉlian
Dataiker

"yyyy-MM" would parse dates with a '-' between the year and the month, for example "2021-01"

To parse "202101" you need to set the format to "yyyyMM" (without the '-')

0 Kudos
cb86
Level 1
Author

Thank you!

0 Kudos