i have to do this operation but it returns exception error .
row13.montant.subtract(row20.montant.add(row21.montant).add(row18.montant).add(row17.montant).add(row3.position)
please how can i resolve this problem?
Thank you
row13.montant.subtract(row20.montant.add(row21.montant).add(row18.montant).add(row17.montant).add(row3.position))
I think you missed last close bracket... check again
Yes of course ,
I'm going to show you my job to understand what i mean :
and this is the SQL request :
Ecart = ( Montant4 - ( Position3 + Montant22 + Montant21 + Montant20 + Montant19 + Montant18 ))
and this is it on Talend :
Ecart= row4.Montant.subtract(row3.Position.add(row22.Montant).add(row21.Montant).add(row20.Montant).add(row19.Montant).add(row18.Montant))
But it returns this error :
Exception in component tMap_1
java.lang.NullPointerException
at java.math.BigDecimal.add(Unknown Source)
at myfirstproject.glob2_0_1.glob2.tMysqlInput_1Process(glob2.java:3288)
at myfirstproject.glob2_0_1.glob2.runJobInTOS(glob2.java:18077)
at myfirstproject.glob2_0_1.glob2.main(glob2.java:17942)
i know how to sum 2 bigdecimal but in this case what can i do i have to sum 6 bigdecimal and substract them .
Thanks for ur answer please help me
Yes of course ,
I'm going to show you my job to understand what i mean :
and this is the SQL request :
Ecart = ( Montant4 - ( Position3 + Montant22 + Montant21 + Montant20 + Montant19 + Montant18 ))
and this is it on Talend :
Ecart=row4.Montant.subtract(row3.Position.add(row22.Montant).add(row21.Montant).add(row20.Montant).add(row19.Montant).add(row18.Montant))
But it returns this error :
Exception in component tMap_1
java.lang.NullPointerException
at java.math.BigDecimal.add(Unknown Source)
at myfirstproject.glob2_0_1.glob2.tMysqlInput_1Process(glob2.java:3288)
at myfirstproject.glob2_0_1.glob2.runJobInTOS(glob2.java:18077)
at myfirstproject.glob2_0_1.glob2.main(glob2.java:17942)
i know how to sum 2 bigdecimal but in this case what can i do i have to sum 6 bigdecimal and substract them .
Thanks for ur answer please help me
Hi Emy,
You have null pointer exception... it means some of your column contains null value...
You will have to handle null for each column like - check the post - http://www.talendforge.org/forum/viewtopic.php?id=7782
row2.Price2==null?row1.Price1:row1.Price1.add(row2.Price2)
This is going to be a two to three line code if you do it in single tMap... but if you prefer, you can use tJavaRow to make it more simple and add it column wise..
Vaibhav
hi all,
my question is "is it normal that you have null value" ?
manage null value is a tecnical issue but what's your business rule when application 's encountering null value espacially when you're doing calculation ?
how many null value do you have from sources ?
Could it be null ?
regards
laurent