I want to do some sum operation on the field called CHG_AMT.
I am executing below logic,
row1.CHG_CLASS == "OCC" &&
(row1.CHG_DESC_1 == "Late Payment Charge" ||
row1.CHG_DESC_1 == "Late Charge on Past Due Balances" ||
row1.CHG_DESC_1 == "Late Fee" ||
row1.CHG_DESC_1 == "Finance Charge" ||
row1.CHG_DESC_1 == "Late Payment Interest" ||
row1.CHG_DESC_1 == "Late payment charge on unpaid balance") ?
sum(row1.CHG_AMT) : 0
The error I am facing is with data type of CHG_AMT in the input.
So how do I convert this to Decimal and do Sum operation?
Any help is appreciated.
What is the data type of AMT field coming as input & whats the data type of derived field? Based on that we can advice you conversion..
Input field is something like 23.34 which is of string type and need to convert that amount field suppose in the second line item will be 34.23. So I have to sum it up and show as amount field.
Have you already tried to use Double.parseDouble(name_of_your_input_field) or
in tMap expression?
tAggregateRow component provides the aggregation key and the relevant result of set operations (min, max, sum...).
For a description of tAggregateRow, please check the documentation user guide.
Is there any update for your issue?