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

Announcements
Discover how organizations are unlocking new revenue streams: Watch here
cancel
Showing results for 
Search instead for 
Did you mean: 
Anonymous
Not applicable

tMap comparison of two Dates

Hello Talend community , 

i am new on talend and i have this problem ,

I am using a tMap between two tables (Table 1 and Table 2 )
i am using and ID ti join between the two table  table1.id=table2.id

But i need to add a condition on a Date , the condition is  table1.date > table2.date , 
but when i write it like this (see picture ) on tmap it gives me an error , can someone help me please

0683p000009MFLe.png

Labels (2)
2 Replies
Anonymous
Not applicable
Author

Hi,
You can not compare date directly in tMap.
Here is a built-in method for comparing date in talend. TalendDate.compareDate(Date date1, Date date2) which return to Integer.
The result wheather two date is the same, if first one less than second one return number -1, equlas return number 0, bigger than return number 1
Please take a look at my screenshot.
Best regards
Sabrina

0683p000009MFLj.png
krengan21
Creator
Creator

Hi sabrina,

After comparing both dates if the date table [T1] is greater than table[T2} ie we will be getting the integer value as 1 ,How to process the data after the date present in the table [T2] what condition should be written to process the data after comparing the date values to process the data greater than the data in table [T2].Where i can write a if else statement to process data