
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Multiplication of values in tMap
Hello Community,
I am pretty new in Talend so this is probably a basic question:
In my If / Else Condition I can´t multiply the two values of column row15.price (Integer) and row15.PLN(Double) in the Expression builder. If I try to test it following Error occurs:
Exception in thread "main" java.lang.Error: Unresolved compilation problem:
row15.currency.equals("PLN") ? row15.price*row15.PLN : "AA"
Accepted Solutions

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Double.parseDouble(row15.price)*Double.parseDouble(row15.PLN)

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Try to change "AA" by something like -1.0 to signify the currency wasn't equal to PLN.

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hello TRF,
thank you very much for your answer.
When I change the "(if/else) results" to the same Datatype (e.g. assigning it to one variable) it works but I still can´t do a multiplication because it reads everything as a String. If I build a sum of e.g. 3.9+3.9 = 3.93.89 as you can see in the picture.
How can I check if something equals "PLN" in the currency and then do a proper multiplication of doubles if it does and "else" give back a double:
row15.currency.equals("PLN") ? row15.price*row15.PLN : row15.price
I really appreciate your help. Thank you!

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Double.parseDouble(row15.price)*Double.parseDouble(row15.PLN)
