Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
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
Hi,
I believe you are looking for this solution.
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.
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 🙂
Hi @mbocquet ,
Could you please elaborate more on your issue.
Regards,
Bharath.
Kudos are accepted if this gave you the solution.
Hi,
I believe you are looking for this solution.
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.
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 🙂