Skip to main content
Announcements
Introducing Qlik Answers: A plug-and-play, Generative AI powered RAG solution. READ ALL ABOUT IT!
cancel
Showing results for 
Search instead for 
Did you mean: 
Anonymous
Not applicable

Filter on calendar date

Hello,

 

I have been struggling for days on this filter.

 

I have to filter data that's 3 months older than the extraction date. For example, if my product arrived on the 10-03-2019 (column DATE_ARRIVAL, its formatted yyyyMMdd), I dont want it to appear in my extracted file after the 10-06-2019. 

 

I've tried to use a long type filter: TalendDate.diffDate(TalendDate.parseDate("yyyyMMdd",TalendDate.getDate("CCYYMMDD")),DATE_ARRIVAL,"MM") < 3 but it filters out all products arrived in june.

 

Any help would be grateful.

 

Thanks in advance

 

 

 

 

Labels (1)
1 Solution

Accepted Solutions
Anonymous
Not applicable
Author

Hi,

 

    I believe you are looking for this solution.

0683p000009M5Xb.png

 

The first step you will have to do is to read your input column in date format itself (in "yyyyMMdd") instead of String. In the tMap, you will have to add the following condition.

0683p000009M5L7.png

 

TalendDate.diffDate(TalendDate.getCurrentDate(),row2.DATE_ARRIVAL,"MM") >=3

Hope you are happy with the solution. Please spare a second to mark the topic as resolved 🙂 Kudos will be a bonus!

 

Warm Regards,
Nikhil Thampi

Please appreciate our Talend community members by giving Kudos for sharing their time for your query. If your query is answered, please mark the topic as resolved 🙂

 

 

 

View solution in original post

2 Replies
javvaji
Creator II
Creator II

Hi @mbocquet ,

 

Could you please elaborate more on your issue.

 

Regards,

Bharath.

 

Kudos are accepted if this gave you the solution.

Anonymous
Not applicable
Author

Hi,

 

    I believe you are looking for this solution.

0683p000009M5Xb.png

 

The first step you will have to do is to read your input column in date format itself (in "yyyyMMdd") instead of String. In the tMap, you will have to add the following condition.

0683p000009M5L7.png

 

TalendDate.diffDate(TalendDate.getCurrentDate(),row2.DATE_ARRIVAL,"MM") >=3

Hope you are happy with the solution. Please spare a second to mark the topic as resolved 🙂 Kudos will be a bonus!

 

Warm Regards,
Nikhil Thampi

Please appreciate our Talend community members by giving Kudos for sharing their time for your query. If your query is answered, please mark the topic as resolved 🙂