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

Announcements
See why IDC MarketScape names Qlik a 2025 Leader! Read more
cancel
Showing results for 
Search instead for 
Did you mean: 
Anonymous
Not applicable

[resolved] tFilterRow - can not filter on dates

Hi there,
Trying to filter on a date column in v.3.2.1 but it fails with error
-- The method compareTo(Date) in the type Date is not applicable for the arguments (int)

These are my comparasions
sl_date >= 01/01/2004
sl_date <= 01/31/2004
date format is "MM/dd/yyyy".
Labels (2)
1 Solution

Accepted Solutions
Anonymous
Not applicable
Author

Hello
sl_date <= TalendDate.parseDate("MM/dd/yyyy","01/01/2002"))

but I got error message
Syntax Error on token "&&", Expression expected after job ImportSalesData

The correct expression is:
sl_date <= TalendDate.parseDate("MM/dd/yyyy","01/01/2002")

Best regards
shong

View solution in original post

10 Replies
Anonymous
Not applicable
Author

Hello,
Instead of 01/01/2004 String for your comparaison, can you try with TalendDate.parseDate("MM/dd/yyyy","01/01/2004")) ?
Regards,
SeB
Anonymous
Not applicable
Author

Hello,
Instead of 01/01/2004 String for your comparaison, can you try with ?
Regards,
SeB

Hi samlleret, thank for reply.
I did put TalendDate.parseDate("MM/dd/yyyy","01/01/2004")) in Value field so my filter looks like this now
sl_date <= TalendDate.parseDate("MM/dd/yyyy","01/01/2002"))

but I got error message
Syntax Error on token "&&", Expression expected after job ImportSalesData
Anonymous
Not applicable
Author

Hello
sl_date <= TalendDate.parseDate("MM/dd/yyyy","01/01/2002"))

but I got error message
Syntax Error on token "&&", Expression expected after job ImportSalesData

The correct expression is:
sl_date <= TalendDate.parseDate("MM/dd/yyyy","01/01/2002")

Best regards
shong
Anonymous
Not applicable
Author

Thank shong and sorry for my mistake in my copy and paste 😉
Anonymous
Not applicable
Author

Well, I am getting error on tInformixInput now.
-- SQLException: Unable to build a date Object based on localized date stream representation.
I derived schema out of real table and I am not sure why it fails. "Date Pattern" "MM/dd/yyyy" was default one chosen by schema builder.
Anonymous
Not applicable
Author

After fixing schema issues this line worked just fine
sl_date <= TalendDate.parseDate("MM/dd/yyyy","01/01/2002")

Thanks
_AnonymousUser
Specialist III
Specialist III

I have tried below formula in tMAP, but get an expression error message.
row1.DATUM >= TalendDate.parseDate("yyyy-MM-dd","2010-01-01")
What might cause the error?
Anonymous
Not applicable
Author

What is datatype of row1.DATUM?
You can't compare date like this in talend....
Check following post
https://community.talend.com/t5/Design-and-Development/Date-comparison-in-Tmap-fails/td-p/80901
Vaibhav
Anonymous
Not applicable
Author

Hi how can i filter one date field to today's date.
Can you please show using tmap and tfilter row both
.
Scenario is like:
Input file excel.
Date column in MM/dd/yyyy format