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

Announcements
Qlik Connect 2026 Agenda Now Available: Explore Sessions
cancel
Showing results for 
Search instead for 
Did you mean: 
Anonymous
Not applicable

null pointer exception

Hi experts,

I'm facing null pointer exception in Tmap when I'm doing calculation below you can see in screen shot,

and I already checked in database for same calculation but their are no null values in them how to resolve this error

 

Thanks in advance 

Regards

A.Sumanth0683p000009LvUm.png0683p000009LvUr.png0683p000009LvUw.png0683p000009LvTu.png

Labels (2)
1 Solution

Accepted Solutions
cterenzi
Specialist
Specialist

Community all-star, @rhall, wrote a very nice guide on how to identify which rows are causing errors in a tMap:

https://www.rilhia.com/quicktips/quick-tip-how-debug-tmap-errors

 

If this works for you, throw him some kudos.

View solution in original post

8 Replies
Anonymous
Not applicable
Author

Are you sure it is row18 or row1 the object?

Anonymous
Not applicable
Author

Ya sure it is row18
Anonymous
Not applicable
Author

Ya it's row18
Anonymous
Not applicable
Author

Please provide screenshots of your job and tMap mapping.  Not sure what it is.

Anonymous
Not applicable
Author

0683p000009Lv6c.png0683p000009LvMQ.png0683p000009Luyi.png

cterenzi
Specialist
Specialist

Community all-star, @rhall, wrote a very nice guide on how to identify which rows are causing errors in a tMap:

https://www.rilhia.com/quicktips/quick-tip-how-debug-tmap-errors

 

If this works for you, throw him some kudos.

Anonymous
Not applicable
Author

If row18.CUST_TOTAL_QUOTA_BEFORE and row18.CUST_TOTAL_QUOTA_USED_BEFORE are both Java Objects of type Double (i.e. they are set as nullable), and are not Java primitive type double,  then you should do the expression as follows

 

row18.CUST_TOTAL_QUOTA_BEFORE!=null && row18.CUST_TOTAL_QUOTA_USED_BEFORE!=null ? new Double(row18.CUST_TOTAL_QUOTA_BEFORE.doubleValue() - row18.CUST_TOTAL_QUOTA_USED_BEFORE.doubleValue()) : null)

 

This is an inline if statement.  We are checking first that none of the 2 objects are null. Then if both are not null, we do the double substraction, and return a new Double object since your target column is also of type Double.  If one or both of the Double objects are null, then we return null.  It is up to you to figure out what to do if one of them is null.

 

If these values can never be null in the database, then you will simplify the logic by unchecking the nullable attribute on the column to make the type of double Java primitive type.  However, if they can be null, then you should program as above, i.e. defensively checking for nulls.

 

Anonymous
Not applicable
Author

Thank you so much expert,I was struggling with this problem from past ten days you are the one who gave me correct

solution from my question,By understanding the question properly

I need the expert like you for solutions thank you once again it's working fine 

Regards

A.Sumanth