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

[resolved] tFilterRow, comparing two dates

Hi,
I have to filter the rows from a database input and take only the ones where the date is bigger than "31-12-2011".
This part of the job looks like this:
tOracleInput_1 ------------> tFilterRow1 ------ ...
In the basic settings of tFilterRow1 I used advanced mode and my code is this:
TalendDate.formatDate("dd-MM-yyyy", CON_F_CONTRATOSx1.ID_MES_FEFAIN) > "31-12-2011"

When i try to run the job but I get an error saying that I can't use ">" with String types, how can I do this?

Thanks in advance,
Khor.
Labels (2)
1 Solution

Accepted Solutions
Anonymous
Not applicable
Author

Hi mpa and toos,
I'm a bit embarrassed, sometimes when I have a problem i'm too focused on solve it in one way to go back and think about it from the beginning. Now that you told me this simple solution I realized that it was a really newbie question, I'm sorry.
Thanks for answer my question that fast and give me what i needed and more,
Khor.

View solution in original post

3 Replies
Anonymous
Not applicable
Author

Khor,
I think it would be better if you use this in a where statement in your query of the tOracleInput.
There it will work with the ">" operator and it will directly filter out the rows which will make your job faster.
Because right now you are getting all the rows from your database and then filtering. If you filter the data directly in your query it will only need to get the required rows from the database.
If you still want to use your method by using the tFilterrow, then you should try the following:
TalendDate.compareDate(myDate1,myDate2,"yyyy-MM-dd") > 0
Hope it works :-)
Regards
toos
Contributor
Contributor

I suggest :
TalendDate.compareDate(
TalendDate.formatDate("dd-MM-yyyy", CON_F_CONTRATOSx1.ID_MES_FEFAIN),
TalendDate.formatDate("dd-MM-yyyy", "31-12-2011"))
Anonymous
Not applicable
Author

Hi mpa and toos,
I'm a bit embarrassed, sometimes when I have a problem i'm too focused on solve it in one way to go back and think about it from the beginning. Now that you told me this simple solution I realized that it was a really newbie question, I'm sorry.
Thanks for answer my question that fast and give me what i needed and more,
Khor.