Aggregator(Destination: IAutoCubeDestination): IMatrixAggregatorModel;
Destination. Cube display version, for which dimension aggregation must be set up.
The Aggregator property determines aggregation parameter by dimension for the specified cube display version.
Executing the example requires that the repository contains an automatic cube with the AUTO_CUBE identifier. The first cube dimension must contain more than one level.
Add links to the Cubes, Dimensions, Matrix, Metabase system assemblies.
Sub UserProc;
Var
MB: IMetabase;
MObj: IMetabaseObject;
AutoCub: IAutoCube;
Dim: IAutoCubeDimension;
AggregatorManager: MatrixAggregatorManager;
IAggregatorManager: IMatrixAggregatorManager;
AggregatorModel: IMatrixAggregatorModel;
BasicAggregator: IBasicMatrixAggregator;
LevelBasicAggregator: IBasicMatrixLevelAggregator;
Dimension: IAutoCubeDimension;
DimensionModel: IDimensionModel;
Begin
// Get current repository
MB := MetabaseClass.Active;
// Get automatic cube
MObj := MB.ItemById("AUTO_CUBE").Edit;
AutoCub := MObj As IAutoCube;
Dim := AutoCub.Dimensions.Item(0);
//Create a new object
AggregatorManager := New MatrixAggregatorManager.Create;
IAggregatorManager := AggregatorManager As IMatrixAggregatorManager;
//Create an identifier of aggregation mechanism
AggregatorModel := IAggregatorManager.CreateAggregator("BasicMatrixAggregator");
Dimension := AutoCub.Dimensions.Item(0);
DimensionModel := Dimension.Dimension;
//Determine dimension that is used to set up aggregation
AggregatorModel.Dimension := DimensionModel;
BasicAggregator := AggregatorModel As IBasicMatrixAggregator;
//Determine source level and destination level
LevelBasicAggregator := BasicAggregator.LevelAggregation(DimensionModel.Levels.Item(0));
LevelBasicAggregator.Include(DimensionModel.Levels.Item(1)) := True;
//Determine aggregation method - Actual mean
LevelBasicAggregator.Operation := BasicAggregatorOperation.ActualMean;
//Determine whether non-aggregated data is saved
LevelBasicAggregator.PreserveExistingData := False;
//Determine whether values on destination level are taken into account on putting aggregated data to this level
LevelBasicAggregator.IncludeOwner := False;
//Determine aggregation parameters for dimension in automatic cube
Dimension.Aggregator(AutoCub.Destinations.Item(0)) := AggregatorModel;
MObj.Save;
End Sub UserProc;
After executing the example the data aggregation is set up for the first automatic cube dimension. Aggregation is executed from the second level to the first, aggregation method that is actual mean.
See also: