cancel
Showing results for 
Search instead for 
Did you mean: 

Summing the amount associated with same report ids

Former Member
0 Kudos

Hi,

I will be getting a file with report id and amount associated with it. The report Id may be repetitive. My requirement is to cumulatively add the amount associated with same report ids and store it in a target field.

Please let me know how I can achieve this.

Regards,

Sandhya

Accepted Solutions (0)

Answers (3)

Answers (3)

Former Member
0 Kudos

Hi Sandhya,

This should be easy to achieve with standard functions:

On the target amount field do the mapping as below

ReportID(context at root level)->Sort->SplitByValue(value change)->Queue1

Amount (context at root level) ->SortbyKey(on ReportID)->FormatByExample (with Queue1 ) ->Sum (each Context)->Target Amount field

Only do the context handling carefully depending on how the ReportID and Amount fields are arranged in the file structure hierarchy.

markangelo_dihiansan
Active Contributor
0 Kudos

Hello,

I will be getting a file with report id and amount associated with it.

The file you will be getting is already in xml format or just a text file (e.g csv)? If it is the latter you need to use FCC(file content conversion) so that you can manipulate the contents using graphical mapping.

The report Id may be repetitive. My requirement is to cumulatively add the amount associated with same report ids and store it in a target field.

This can be achieved, but we need to know the xml structure first

Hope this helps,

Mark

Former Member
0 Kudos

The report_id & amount are fields contained into the file? If yes, you can solve by using an UDF function in mapping.

Input all file raw to the UDF, sort by report_id, loop&break at change report_id event... then sum amount.

If the requirement is different, please explain better your request.