AnsweredAssumed Answered

Sum Values from a list after splitting by type

Question asked by BenMiller3461 on Nov 16, 2016
Latest reply on Oct 29, 2017 by steven.miller750570

Example List:

<tranCust:applyList>
<tranCust:apply>
<tranCust:type>Invoice</tranCust:type>
<tranCust:amount>245.65</tranCust:amount>
</tranCust:apply>
<tranCust:apply>
<tranCust:type>Customer Refund</tranCust:type>
<tranCust:amount>14.45</tranCust:amount>
</tranCust:apply>
</tranCust:applyList>

 

What I need to do is take all the Amounts that are of the type Invoice and sum them (there could be multiple).  I need to do the same thing as a separate sum for Customer Refund.  If I create a User Function it will not allow multiple Sum operations to be added to it.  I could separate them on the type and then run them through another map with a sum function there.  I will likely try that next, but I wondered if there was a better way to do something like this.  

Outcomes