cancel
Showing results for 
Search instead for 
Did you mean: 

Sum value from multiple Record - Mapping

Former Member
0 Kudos

Hi

I have below requirment is there any way to do

<main>
<Record>
<r1>233435345345345></r1>
</REcord>

<Record>
<r1>2423424234234242</r1>
</Record>

<Record>
<r1>3454545454545444</r1>
</Record>

<Record>
<r1>234534534534534</r1>
</Record>

</main>

if ther record starts with 2 I have to do
substring(1,4) that is 334 and in second record 423 and total (334 + 423) assiging it to a field  . and again  4th record i have to start the
total freshely is there any way to achive in graphical mapping

Thaks

Ram

Accepted Solutions (1)

Accepted Solutions (1)

Former Member
0 Kudos

Hello,

According to u, what should be the output for below input?

<main>
<Record>
<r1>233435345345345></r1>
</REcord>

<Record>
<r1>2423424234234242</r1>
</Record>

<Record>
<r1>2454545454545444</r1>
</Record>

<Record>

<r1>434534534534534</r1>

</Record>

<Record>
<r1>234534534534534</r1>
</Record>

</main>

Thanks

Amit Srivastava

Former Member
0 Kudos

<main>
<Record>
<r1>233435345345345></r1>
</REcord>

<Record>
<r1>2423424234234242</r1>
</Record>

<Record>
<r1>2454545454545444</r1>
</Record>

<Record>

<r1>434534534534534</r1>

</Record>

<Record>
<r1>234534534534534</r1>
</Record>

</main>

I should have two total amount 1st one(334+423+454) 1211 and  second one 345

Former Member
0 Kudos

Hello,

Check this:

Note - use SplitByValue(empty value) function

Thanks

Amit Srivastava

former_member191435
Contributor
0 Kudos

Hi Jai ram,

If you dont bother about the record which is not start with 2 then You can go ahed what Amit has suggested. It should work...

If you need the record other than start with 2 also ... then you need to change the mapping...

Please confirm...

Thanks,

Sreenivas

Former Member
0 Kudos

Hi

Thank you for your quick reply

The mapping above  is suming all the values starts with 2  see my requirment i am suming first three and putting to a total and second total is only 345 (since only one record is there). if there is intereption for that record the total is done seperately( in our case the 4th record starts with 4) the continunity is lost

<main>
<Record>
<r1>233435345345345></r1>
</REcord>

<Record>
<r1>2423424234234242</r1>
</Record>

<Record>
<r1>2454545454545444</r1>
</Record>

<Record>

<r1>434534534534534</r1>

</Record>

<Record>
<r1>234534534534534</r1>
</Record>

</main>

I should have two total amount 1st one(334+423+454) 1211 and  second one 345

Thanks

Ram

former_member191435
Contributor
0 Kudos

Hi Ram,

Can you please elaboratley more...

As per my understanding it has to sum the records which starts with 2 in continus flow... right .. If it is like that it should work as suggested By amit....

Can you please let me know more elaboratley what you need...

Thanks,

Sreenivas

former_member193466
Participant
0 Kudos

Hi Ram,

Use Split by value(Value change) instead of empty value.

It gives you the result.

Former Member
0 Kudos

Hi

I tried that it is not working

Thanks

Ram

Former Member
0 Kudos

Hello,

I have tested above mapping and it's perfectly working fine. The output of mapping is, but u can format it as per ur target structure.

1211

Context Change

345

BTW, check sum function output:

Paste ur target structure and the output of display queue of SUM function in ur mapping?

Thanks

Amit Srivastava

Message was edited by: Amit Srivastava

Former Member
0 Kudos

I want only values starting with 2

former_member191435
Contributor
0 Kudos

then it must work as suggested by Amit...

Otherwise please paste the target payload and let us know how you required..

Thanks,

Former Member
0 Kudos

Hi

Please find my attached target structure

Thanks

Ram

former_member193466
Participant
0 Kudos

Hi,

Try as below

former_member191435
Contributor
0 Kudos

For that Output strutucte how you want the data elaborate plss...

Answers (1)

Answers (1)

Former Member
0 Kudos

Hello,

No one on earth could help u until and unless u don't post ur questions properly.

U should always try to give as much information as possible in a correct manner.

Thanks

Amit Srivastava

Former Member
0 Kudos

Hi

Please find my mapping i have done the same

Former Member
0 Kudos

Hello,

Since there are multiple occ of Distributor Invoice node (which i believe is directly mapped to Main node?) so mapping logic needs to be adjusted.

Tell me one thing, is there any mapping logic for PaymentOrder*** becoz i can see it as unbounded node or always one Invoice node will have only one PaymentOrder*** Node?

Thanks

Amit Srivastava

Former Member
0 Kudos

Yes i am checking the condition once the value starts with 2 i will create  the node

Payment order will be repated and there will one invoice and invoice amount in one payment order

former_member191435
Contributor
0 Kudos

Hi Ram,

If MSGDATA = PASS then it never start with 7 which is wrong in your mapping...

If you want to check MSGDATA exists and start with 7 then you have to use exist node function...

Dont use remove context in first If satement

Thanks,

Sreenivas Veldanda.

Former Member
0 Kudos

Actually the MSGDATA_start is a udf i am checking one condition and then 7 is the subcondition . Actually in the screen shot i am not able to show that one

MSGDATA - > MSGDATA_Start

that is correct

former_member191435
Contributor
0 Kudos

Jai ram,

Can you please send your sample test data and require output data and the mapping you have done...

Please provide full details...

Thanks,