AnsweredAssumed Answered

Get sum to check whether total balanced

Question asked by britto.parthalomew on Jul 17, 2018
Latest reply on Aug 8, 2018 by britto.parthalomew

Hello folks,

 

I have a requirement where I need to add up 2 amount for multiple items. And I need to check whether the debit and credit are balanced. Though this looks simple but my mind stopped working

I need your suggestions.

Input xml:

<?xml version='1.0' encoding='UTF-8'?>
<fileContents>
<externalId>YTD</externalId>
<transactionDate>04/30/2018</transactionDate>
<currency>British Pound</currency>
<geography>United States</geography>
<subsidiary>1111</subsidiary>
<sourceSystem>H</sourceSystem>
<debitTotal></debitTotal>
<creditTotal></creditTotal>
<lineItems>
<acExternalId>123</acExternalId>
<creditAmt>2418855.04</creditAmt>
<entityExternalId>987</entityExternalId>
<funCode>Q</funCode>
<geo>United States</geo>
<reference>B</reference>
<lineDesc>Nothing</lineDesc>
</lineItems>
<lineItems>
<acExternalId>234</acExternalId>
<debitAmt>2418855.04</debitAmt>
<entityExternalId>876</entityExternalId>
<funCode>Q</funCode>
<geo>United States</geo>
<reference>C</reference>
<lineDesc>Nothing</lineDesc>
</lineItems>
<lineItems>
<acExternalId>345</acExternalId>
<creditAmt>3452.04</creditAmt>
<entityExternalId>765</entityExternalId>
<funCode>Q</funCode>
<geo>United States</geo>
<reference>D</reference>
<lineDesc>Nothing</lineDesc>
</lineItems>
<lineItems>
<acExternalId>456</acExternalId>
<debitAmt>3452.04</debitAmt>
<entityExternalId>654</entityExternalId>
<funCode>Q</funCode>
<geo>United States</geo>
<reference>E</reference>
<lineDesc>Nothing</lineDesc>
</lineItems>
</fileContents>

 

Requirement is to add up all debits and assign to debitTotal and same way for creditTotal to the header element. I tried with Sum but some how not working. I even created a function (in Intermediate map) where I add the debit and credit respectively and assign to DDP but still not getting the total. 

 

Any help would be appreciated.

 

Thank you

Britto

Outcomes