AnsweredAssumed Answered

How can I calculate the sum of a column, then use that sum to perform another calculation?

Question asked by B816T5YG on Mar 28, 2019
Latest reply on Apr 1, 2019 by B816T5YG

I need to perform a number of calculations. The first part is to find the sum of a particular column and then divide the sum by it's single value in the row.

LiabilityBal / Sum of LiabilityBal.

 

I've created a data grid with some test data, and used a group by step to perform the aggregation. This performs the calculation I need.

 

The non-populated fields need to be calculated, with WeightedAmtCalc being calculated with the above formula.grid data.PNG

 

 

steps.PNG

 

I've tried splitting the streams and using a lookup on the id, but that only matches one row.

group.PNG

 

This is the result I get, Ideally I would like to have the sum on each row. The sum field on row 1 is the sum of all of the fields in the second column.

result.PNG

 

Is there a way for me to put the sum back into data stream where the sum appears on each row, so that I can then perform the calculation?

 

Thanks for your time

Outcomes