Skip to main content
Announcements
See what Drew Clarke has to say about the Qlik Talend Cloud launch! READ THE BLOG
cancel
Showing results for 
Search instead for 
Did you mean: 
SSV1
Contributor
Contributor

Null pointer exception in double datatype data. Need your inputs to fix this.

Dear Talend Community,

Good day to all.

Extracting amount data from spreadsheet and providing datatype as double. While i am performing some calculations it throwing "Null pointer Exception issue".

Is there a way without ignoring the row and process the calculation. Could you please let me know fix for this issue.

Example:

Amount1 Amount2 Result(Addition)

10.00 10.00 20.00

10.00 10.00

10.00 10.00

ThankYou,

Sakthi

Labels (4)
1 Solution

Accepted Solutions
Anonymous
Not applicable

change the expression to:

row1.Amount1==null?(row1.Amount2==null?0:row1.Amount2):(row1.Amount2==null?row1.Amount1:row1.Amount1+row1.Amount2) ​

View solution in original post

4 Replies
Anonymous
Not applicable

Hi

There must exist Null value in source data. Can you show us the expression which you perform the calculations?

 

Regards

Shong

SSV1
Contributor
Contributor
Author

Hi Shong,

 

Thank you for the reply. Yes you are right data has null. Below is the expression.

 

Amount1+Amount2 in the expression

 

ThankYou,

Sakthi

Anonymous
Not applicable

change the expression to:

row1.Amount1==null?(row1.Amount2==null?0:row1.Amount2):(row1.Amount2==null?row1.Amount1:row1.Amount1+row1.Amount2) ​

SSV1
Contributor
Contributor
Author

Hi Shong,

 

Thank You.

 

To handle this scenario first tmap check the column with relation null and handled it using below format.

 

Relational.ISNULL(columnname)?0:columnname

 

With this closing this topic. Thank you once again.

 

ThankYou,

Sakthi