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: 
Urba34
Contributor
Contributor

TOS 7.3 - tMap - TalendDate.diffDate why we can not have null as ouput ?

Hi evryone,

I'm using this formula on a tMap component in var section

(

row1.tech_setr1appointementdate!=null

&&

row1.tech_setr2date!=null

)?

TalendDate.diffDate(row1.tech_setr2date,row1.tech_setr1appointementdate,"dd"):

0

it's working but when i trie to replace 0 by "null" then i have a errror "java.lang.NullPointerException: null"

(

row1.tech_setr1appointementdate!=null

&&

row1.tech_setr2date!=null

)?

TalendDate.diffDate(row1.tech_setr2date,row1.tech_setr1appointementdate,"dd"):

null 

I have allow the nullable result on the ouput

0695b00000Ht29mAAB.png

Thanks for your help 🙂

Labels (3)
1 Solution

Accepted Solutions
Anonymous
Not applicable

Hi

try to use this expression on the output rather than Var area, there is no Nullable option in the Var area.

 

Regards

Shong

 

View solution in original post

8 Replies
Anonymous
Not applicable

Hi

try to use this expression on the output rather than Var area, there is no Nullable option in the Var area.

 

Regards

Shong

 

Urba34
Contributor
Contributor
Author

Hello,

 

Thanks for your quick answer. I got the same result

 

 

 

Urba34
Contributor
Contributor
Author

 
Anonymous
Not applicable

I am not able to reproduce the NPE when I set it to null for a long type. Can you try this expression:

(

row1.tech_setr1appointementdate==null

||

row1.tech_setr2date==null

)?null:TalendDate.diffDate(row1.tech_setr2date,row1.tech_setr1appointementdate,"dd")

 

Urba34
Contributor
Contributor
Author

 

Unfortunately I have the same error

Urba34
Contributor
Contributor
Author

hi back,

 

 

I think it's about a parameters in my TOS 7.3 no ?

Urba34
Contributor
Contributor
Author

Hi for the futur guys how pass throw this post the answer was to copy past

this code

(

row1.tech_setr1appointementdate!=null

&&

row1.tech_setr2date!=null

)?

TalendDate.diffDate(row1.tech_setr2date,row1.tech_setr1appointementdate,"dd"):

null 

 

directly on the output et and not on the variable

Anonymous
Not applicable

I see you marked this question as resolved and select my answered as best answer. Thanks for your confirmation and feedback.

 

Regards

Shong