I have a bound RadGrid which has three columns that are aggregated (Aggregate="Avg") on it. These three columns are of type currency. My challenge here is that the aggregation needs to be conditional based upon the value in the cell. If the value is $0.00, then it should not be included in the Average calculation. I know this seems odd, but it's the request that my users are giving to me.
Take the following example of the data in a segment of the grid
Sale Amount
$45.00
$50.00
$100.00
$0.00
-----------
Avg $48.75
The average calculation will be the sum of fields divided by the row count or (45 + 50 + 100 + 0) / 4 = 48.75
HOWEVER
What my users want is for this calculation to be (45 + 50 + 100 + 0) / 3 = 65 They want the row with $0.00 to not be included in the average calculation.
The documentation for the Aggregate (http://www.telerik.com/help/aspnet-ajax/grdtotalsingridfooters.html) has a little tidbit on the first page which *might* be what I'm looking for, but I'm not sure if it is or how to use it:
" RadGrid will calculate aggregates over the entire data source and will respect the filter expression applied (if present)"
Any assistance is very much appreciated!
Thank you,
Michael Smith
Take the following example of the data in a segment of the grid
Sale Amount
$45.00
$50.00
$100.00
$0.00
-----------
Avg $48.75
The average calculation will be the sum of fields divided by the row count or (45 + 50 + 100 + 0) / 4 = 48.75
HOWEVER
What my users want is for this calculation to be (45 + 50 + 100 + 0) / 3 = 65 They want the row with $0.00 to not be included in the average calculation.
The documentation for the Aggregate (http://www.telerik.com/help/aspnet-ajax/grdtotalsingridfooters.html) has a little tidbit on the first page which *might* be what I'm looking for, but I'm not sure if it is or how to use it:
" RadGrid will calculate aggregates over the entire data source and will respect the filter expression applied (if present)"
Any assistance is very much appreciated!
Thank you,
Michael Smith