XSLT : Cummulative Sum

venkatasiva yadav 231 Reputation points
2021-07-07T03:55:28.19+00:00

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>

Microsoft BizTalk Server
Microsoft BizTalk Server
A family of Microsoft server products that support large-scale implementation management of enterprise application integration processes.
388 questions
0 comments No comments
{count} votes

Accepted answer
  1. venkatasiva yadav 231 Reputation points
    2021-07-07T07:57:23.797+00:00

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

    0 comments No comments

0 additional answers

Sort by: Most helpful

Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.