Hi,
Is it possible to use other functions for measures like Avg, Min, Max and Count besides Sum?
Many thanks and best regards,
Tamás
Hi
For now aggregation functions are supported from FlatDataProvider. If you use it you can apply different aggregation function to the measure you want to. Bellow is the code how to do this:
IOlapViewModel viewModel = pivotGrid.DataSource;
viewModel.SetMeasureAggregator((IMeasureViewModel)viewModel.Measures[0], MeasureAggregator.Max);
viewModel.RefreshGrid();
where viewModel.Measures[0] is the first measure in measures list.
Todor
Hi Todor,
I am using the code which you have posted. But i am not able to see the Aggregated value in the PivotGrid.
In my code, i am using FlatDataSource. Have two Measures. For one i have to show Aggregation as Average and for the other Sum.
Can you please let me know if there is any property on the grid/datasource which needs to be set of enabling of Aggregations.Or,Can you please provide me a working sample.
Following is the code i am writing.
dataSource =
()
{
ItemsSource = list,
Cube =
),
Rows =
//Columns = DataSourceBase.GenerateInitialItems("[[Population Set].[Population Set]]"),
Filters =
Measures =
)
};
PivotGrid.DataSource = dataSource;
PivotDataSelector.DataSource = dataSource;
viewModel = PivotGrid.DataSource;
viewModel.SetMeasureAggregator((
.Average);
.Sum);
Thanks,Sachin