The Dataiku Frontrunner Awards have launched to recognize your achievements! SUBMIT YOUR ENTRY

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
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
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’écran 2021-05-20 à 16.15.20.png

0 Kudos
CoreyS
Community Manager
Community Manager

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 DSS 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
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
cb86
Level 1
Author

Thank you!

0 Kudos
A banner prompting to get Dataiku DSS
Public