Datagrid grouping with weighted averages

Let's say I have a 4 column, 2 row table. Headers [StrategyName], [AccountName], [CurrentValue], [StockPercentage], with the following data:

MyStrategy, Account1, $100.00, 60%

MyStrategy, Account2, $500.00, 50%


When the grouping occurrs, how do I get the weighted average to show up as a sub total.


The calculation is:

( 100.00 * 0.60 + 500.00 * 0.50 ) / ( 100.00 + 500.00 ) = 0.5166 as Subtotal Value



You will have to set up a totals calculation formula. Try following this article:

https://www.dundas.com/support/learning/documentation/design-view/using-a-custom-total-calculation


For some further reference, here is a list of formulas you can take advantage of in the process.