Converting a String to Date Format through PDI

2,886 views
Skip to first unread message

lyncd...@gmail.com

unread,
Feb 24, 2015, 7:16:50 AM2/24/15
to pentaho-...@googlegroups.com
Hello,

I have been working on trying to convert a string to a date format through the PDI process. I am using the Strings Cut to cut the date from a file name then trying to use the Select values option to convert the string to a date.  When executing the job, I am getting the following error message: Couldn't find field 'filedate' in row!  I performed a preview on the prior string cut step and I am able to see the filedate field without any issues.

Any guidance or suggestions on how to convert a string to a date format would be greatly appreciated. 

Thank You, 
lync 

Nelson Sousa

unread,
Feb 24, 2015, 9:20:12 AM2/24/15
to pentaho-...@googlegroups.com

You don't need the strings cut step to get the date, you can do it with a Calculator step.

However, you should be able to see that field after the strings cut step, I don't think it's removed from the stream.

If your filename is of the type logfile_20150224.txt, you can use the calculator step and use a "Create copy of field A", where field A is your short filename, the data type is Date and the format is 'logfile_'yyyyMMdd'.txt' (notice the quotes for literal 'logfile_' and '.txt').



Nelson Sousa
Business Intelligence Consultant


--
You received this message because you are subscribed to the Google Groups "Pentaho Community" group.
To unsubscribe from this group and stop receiving emails from it, send an email to pentaho-commun...@googlegroups.com.
To post to this group, send email to pentaho-...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/pentaho-community/0a5a013f-7367-4d93-b5ed-a2faf14b37c9%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply all
Reply to author
Forward
0 new messages