Parsed date error

Santi
Level 1
Parsed date error

Hello

There is an error when I am trying to do a parsed date 
"Aww ... Smart Date could not find any format matching your data. Please try a custom format."

This is the error I am getting.

The date format I have is like this: December 27, 2010. and I whant to change to this 2010-12-27

0 Kudos
6 Replies
Turribeach

Try โ€œMMM DD,YYYYโ€ as a custom format. 

0 Kudos
Santi
Level 1
Author

The output is blank

0 Kudos
MickaelH
Dataiker

Hi,

The pattern you should use to parse the date in your example is MMM dd, yyyy

You can refer to the SimpleDateFormat documentation linked to the "Parse date processor": https://docs.oracle.com/javase/7/docs/api/java/text/SimpleDateFormat.html

 

Regards,

Mickaรซl | R&D at Dataiku
Sv3n-Sk4
Level 3

Hello @Santi ,

Not sure it's the best solution but it works.

I would realise several steps in a prepare recipe :

  1. Split on a space delimiter your input column
  2. Replace the month by the corresponding number
  3. Split on a , delimiter (to delete the , after the day)
  4. Concatenate the columns with a - delimiter in the order you like
  5. Remove the useless columns

With these steps, I got the result you wanted.

Hope it helped !

Hadrien

0 Kudos
Santi
Level 1
Author

How can I replace the month to a number?

0 Kudos
Sv3n-Sk4
Level 3

Use the step : Find and Replace

 

But the reponse of @MickaelH works and is quicker!

0 Kudos