on 07-14-2006 4:20 AM
Hi All,
My Source Structure is
<root>
<Header>
<BankCode>8911</BankCode>
<Bank>State Bank Of India</Bank>
</Header>
<Detail>
<AccountNo>12345</AccountNo>
<ChequeNo>000981</ChequeNo>
<Amount>10000</Amount>
</Detail>
<Detail>
<AccountNo>12345</AccountNo>
<ChequeNo>000982</ChequeNo>
<Amount>50000</Amount>
</Detail>
<Detail>
<AccountNo>12345</AccountNo>
<ChequeNo>000983</ChequeNo>
<Amount>45000</Amount>
</Detail>
</root>
My Target Structure is
<Header>
<BankCode>8911</BankCode>
<Bank>State Bank Of India</Bank>
</Header>
<Detail>
<AccountNo>12345</AccountNo>
<ChequeNo>000981</ChequeNo>
<Amount>10000</Amount>
</Detail>
<Detail>
<AccountNo>12345</AccountNo>
<ChequeNo>000982</ChequeNo>
<Amount>50000</Amount>
</Detail>
<Detail>
<AccountNo>12345</AccountNo>
<ChequeNo>000983</ChequeNo>
<Amount>45000</Amount>
</Detail>
<Trailer>
<TotalCheques>3</TotalCheques>
<Total>105000</Total>
</Trailer>
</root>
My requirement is to add all the amount fields in Detail Node (1:Unbounded) and put it into Total field in Trailer Node (1:1)
I thought of using ResultList and parsing it. If any better solution is there then please Suggest me a Solution.
Thanks in advance.
Regards
Nagesh
Hi Nagesh,
You can use the SUM function available in Graphical mapping.
AMOUNT --> REMOVE CONTEXT --> SUM --> TARGET FIELD
Regards,
Bhavesh
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi,
Since the details node is 0..ub, I guess you would have to make use of ResultList in a UDF.
You would have to take all the amount tags as input to the UDF, using a String array, and add them by looping through this array.
Regards,
Smitha.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi,
Map
Amountsum(Statistics)Total
Please try changing the context if the direct mapping does not help.
Regards
Vijaya
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
84 | |
10 | |
10 | |
9 | |
7 | |
7 | |
6 | |
5 | |
4 | |
4 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.