Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
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
change the expression to:
row1.Amount1==null?(row1.Amount2==null?0:row1.Amount2):(row1.Amount2==null?row1.Amount1:row1.Amount1+row1.Amount2)
Hi
There must exist Null value in source data. Can you show us the expression which you perform the calculations?
Regards
Shong
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
change the expression to:
row1.Amount1==null?(row1.Amount2==null?0:row1.Amount2):(row1.Amount2==null?row1.Amount1:row1.Amount1+row1.Amount2)
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