Do not input private or sensitive data. View Qlik Privacy & Cookie Policy.
Skip to main content

Announcements
Join us in Toronto Sept 9th for Qlik's AI Reality Tour! Register Now
cancel
Showing results for 
Search instead for 
Did you mean: 
Anonymous
Not applicable

Talend isDate function generating a java.lang.Error on yyyyMMdd form

I am attempting to use the isDate function in an expression for a incoming 8 character date string to see if it is a valid date or not. The date is in a ?yyyymmdd? format. The expression I am using is as follows: TalendDate.isDate(row1.OPTOUT_DATE,"yyyyMMdd") == true ? TalendDate.parseDate("yyyy-MM-dd",row1.OPTOUT_DATE):null. I am using the Test functionality in Expression Builder to ensure the logic works. It does if I change the date format to ?yyyy-MM-dd?, but not ?yyyyMMdd?. Test window in Expression builder displays the following error when I a date such as 20130906 as a value for the OPTOUT_DATE variable: Exception in thread "main" java.lang.Error: Unresolved compilation problems: . Has anyone encountered this issue before and do you have a resolution or workaround I can use in Talend Expression Builder.
Labels (3)
2 Replies
Anonymous
Not applicable
Author

Shouldn't the formats that you're passing to isDate and parseDate be the same?
alevy
Specialist
Specialist

And don't trust the Test window in Expression builder. Best way is to look at the whole generated Code or run the job.