I have created a class for calculated fields and all works as expected. However where I am having a problem is where I am using something OTHER than a field that is 'summed'. For example I have a column called "Fill Price" which is the total of a x number of fill prices on stock trades. In the pivot grid I want to show the Average Fill Price so I select the option "Average" as the calculation option in the Field List. Again this gives me the desired answer in this column in the pivot grid, however when I go to use that field (Fill Price) in the calculated field it gives me the Total and NOT the Average. The following code is how I get the field in my concrete class for the calculated field however in this case the value in the field titled dbl is the Total fill Price and not the average as I was expecting. How do I get at the Average value?
Thank you
Thank you
AggregateValue agg = aggregateValues.GetAggregateValue("fill Price");
double dbl = agg.ConvertOrDefault<
double
>();