we can use Cumulative Sum functoid for each repeated record and add the result before sending to the destination element
XSLT : Cummulative Sum

I need to do a sum within biztalk map or custom xslt. The sum of different field from different records should be calculated only for providers listed within the 'TotalAmount' Element.
I would appreciate any help. Thanks!
Here is the sample Input XML and output XML.
****Input:****
<BillsReports>
<BillsHeader>
<Electricity> ----Repeat Record
<Consumption>1,234.345</Consumption>
</Electricity>
<Water> ---- Repeat Record
<Consumption>1,234.44</Consumption>
</Water>
<ETax>-- Repeat Record
<E_Tax>12.45</E_Tax>
<ETax>
<WTax> --Repeat Record
<W_Tax>12.34</W_Tax>
</WTax>
<MNCPL>--Repeat record
<CurCharg>2345.43</CurCharg>
</MNCPL>
</BillsHeader>
</BillReports>
output:
<DOCBillReport>
<BillReport>
<Header> ---- no repeat record
<TotalAmount>4,839.005</TotalAmount>
</Header>
</BillReport>
</DOCBillReport>
-
0 additional answers
Sort by: Most helpful