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

Announcements
Qlik Open Lakehouse is Now Generally Available! Discover the key highlights and partner resources here.
cancel
Showing results for 
Search instead for 
Did you mean: 
_AnonymousUser
Specialist III
Specialist III

a simple test on Talendate, need some java help!

Hi,
my question is probably very simple (i am using TOS),
I am using a tmap component, I hava data coming in th component that is a list of people: lastname , firstname, etc (Basic fields). Two columns are dates (datein and dateout) I just want to filter and get only people and compare date are TODAY in
Labels (2)
4 Replies
_AnonymousUser
Specialist III
Specialist III
Author

(sorry, I posted preview message by error)
So to continue :
I want filter to get ONLY people for whicth datin and dateout are dates in between currentdate, adding a filter like this seems to (almost) work :

(
(TalendDate.compareDate(row1.Datum_in_dienst,TalendDate.getCurrentDate())<=0)
&&
(TalendDate.compareDate(TalendDate.getCurrentDate(),row1.Datum_uit_dienst)<=0)
)
the think is that, sometime, the dateout is not defined (empty or null value, i don't know), in this case, i want to take the data too, who can I test this in java?
Many thanks for any help on this.
Anonymous
Not applicable

row1.Datum_in_dienst .before(TalendDate.getCurrentDate()) // not inclusive
&&
row1.Datum_uit_dienst.after(TalendDate.getCurrentDate()) // not inclusive
alevy
Specialist
Specialist

That will cause a Null Pointer Exception if row1.Datum_uit_dienst is null. Use
!row1.Datum_in_dienst.after(TalendDate.getCurrentDate())
&& (row1.Datum_uit_dienst==null || !row1.Datum_uit_dienst.before(TalendDate.getCurrentDate()))
(I also used !after and !before to replicate your previous <= conditions.)
Anonymous
Not applicable

Thank you !