Hi All,
Is it possible to have a column in an UltraGrid that has a formula applied to it which instead of working off each row in the grid, works like a summary instead?
Here's an example in Excel:
So if we had a function that could tak a column that the data is grouped by ('Product Type') and a column specifying the values to aggregate on ('Price'), we could create the 'Total Product Type Price' Formula Column writing a formula along th elines of the following:
sumbygroup( [Price], [Product Type])
However, if we tried to use that formula in a column, the values would simply be the corresponding 'Price' value for that row (simply the 'Price' column repeated).
Is this possible?
Cheers,
Richard
Hi Mike,
Thanks for the prompt suggestions!
I had thought of making use of summaries and the outlook group-by functionality, but the problem is we want to allow the user to evaluate the result AS IF they had grouped by a particular column.
I'll look for an alternative way of doing things.
Oh... another option you might want to consider is to just add a Summary for the Price Column and then use OutlookGroupBy to group the data by Product Type.
Hi Richard,
It looks like you are trying to do something like Excel's SubTotal function here. There is currently no way to do that with CalcManager formulas.
I think what I would do is create a Summary using an ICustomSummaryCalculator. You could write one that takes in a Product Type and then only sums the values of the Price column when the row's Product Type matches up. So then you would add a Summary to the grid for each Product type. If you don't want that summary displayed in the grid, you could hide it by setting the SummaryDisplayAreas to None and then use the InitializeRow event to populate your "Total Product Type Price" column with the value from the appropriate summary for that row.