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

Announcements
Save $650 on Qlik Connect, Dec 1 - 7, our lowest price of the year. Register with code CYBERWEEK: Register
cancel
Showing results for 
Search instead for 
Did you mean: 
muralam
Creator
Creator

Compare two dates

hi Team,

 

i wanted to compare two date columns coming from two tables 

i used TalendDate.compareDate(date1,date2) != 0 as it is returning an integer value this is not expected result

getting null pointer exception in tmap, please help on it.

 

Regards,

Meena

 

Labels (2)
23 Replies
manodwhb
Champion II
Champion II

Yes @rhall,that condition wil work as expected and i have designed the job based on that condition and shared with him.

Anonymous
Not applicable

That's great, but we clearly do not know what the problem is. The information supplied has not been sufficient to identify whether the date comparison has been a red herring or not. My suspicion is that the output filter logic is flawed. But this can only be identified if we get the information. 

 

muralam
Creator
Creator
Author

@manodwhb, @rhall

Thanks for your inputs my issue has been fixed, i am very thankful to you for giving me prompt response

row1.date1 == null && row2.date2 == null ? false :
(
row1.date1!= null && row2.date2!= null ?
(
TalendDate.compareDate(row1.date1,row2.date2)==0? false: true)
:true), i used this condition in tmap

This fixed my issue i compared with nulls too. 

once again Thank you all

 

Regards,

Meena

Anonymous
Not applicable

All you need is this....

TalendDate.compareDate(row1.date1,row2.date2)==0? false : true

....this is redundant....

row1.date1 == null && row2.date2 == null ? false :
(
row1.date1!= null && row2.date2!= null ?