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
What I mean is for example right now you have the filter button for dimensions in the data selector where you can drop the selected dimensions (a filter pops up for the selected dimension). Maybe an aggregation selector could come up for measures in a similar way.
Best regards,
Tamas
This is great, I'll try this. Later on (10.3 or later) is there a plan to put this into the data selector control? Somehow it would be great to provide a UI to select the aggregator function for the measures.
Anyway it's great to see how you guys evolve your products based on feedbacks!
Thanks and best regards,