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

Announcements
Posting on Qlik Community is temporarily paused for some users. Thank you for patience and we'll update you soon!
cancel
Showing results for 
Search instead for 
Did you mean: 
Anonymous
Not applicable

tmap java.lang.nullpointerexception

Hi,
I encountered java.lang.nullpointerexception error in my tmap. I discovered that in my tmap, I added the following expression
==> row1.promo_start_date.getTime()<0?null:row1.promo_start_date
The above expression works fine if the promo_start_date contains 0000-00-00; however, it will fail with java.lang.nullpointerexception error when the promo_start_date contains NULL.
I tried to define the following expression to transform the data to NULL if the promo_start_date = 0000-00-00 or promo_start_date = NULL; however, it doesn't work with error "the operator == is undefined for the argument type(s) long, null" message:
==> row1.promo_start_date.getTime()<0||row1.promo_start_date.getTime()==null?null:row1.promo_start_date
Can you please help how should I define the expression in my tmap so that it will transfer the date to NULL if the date = 0000-00-00 or NULL
Thanks! Any help is really appreciated!
Labels (3)
6 Replies
Anonymous
Not applicable
Author

Hello guy
try
row1.promo_start_date==null||row1.promo_start_date.getTime()<0l?null:row1.promo_start_date

Best regards

shong
Anonymous
Not applicable
Author

Hi Shong,
Thanks for your help, it works great now!
Can you please clarify the following:
1) What does row1.promo_start_date.getTime() < 01 means?
2) What is the difference between row1.promo_start_date.getTime() < 0 & row1.promo_start_date.getTime() < 01?
Thanks again!
Anonymous
Not applicable
Author

Hello
Can you please clarify the following:

Oh, sorry, this is my wrong spell here. It should be:
row1.promo_start_date==null||row1.promo_start_date.getTime()<0?null:row1.promo_start_date
Best regards
shong
Anonymous
Not applicable
Author

Hi Shong,
Thanks for the clarification and your help!!
have a nice day!
Anonymous
Not applicable
Author

Hi,
I am using tELTmysqlMap for my query and since currently there is no result for the query, tELTmysqloutput gives me an error:Exception in component tELTMysqlOutput_1
java.lang.NullPointerException, I am not sure why is tht. Could you help me.
Anonymous
Not applicable
Author

xception in component tFileInputExcel_2
java.lang.IllegalStateException: Bad cell type (3)
at org.apache.poi.xssf.usermodel.XSSFFormulaEvaluator.evaluate(XSSFFormulaEvaluator.java:102)

what does this error mean?