
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
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
Accepted Solutions

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
change the expression to:
row1.Amount1==null?(row1.Amount2==null?0:row1.Amount2):(row1.Amount2==null?row1.Amount1:row1.Amount1+row1.Amount2)

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hi
There must exist Null value in source data. Can you show us the expression which you perform the calculations?
Regards
Shong

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
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

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
change the expression to:
row1.Amount1==null?(row1.Amount2==null?0:row1.Amount2):(row1.Amount2==null?row1.Amount1:row1.Amount1+row1.Amount2)

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
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
