Setting Up Standard Cube Aggregation

Example 1

Executing the example requires a standard cube with the Std_Cube identifier. The cube contains a calendar dimension with the CALENDAR identifier.

Sub Main;
Var
    MB: IMetabase;
    MObj: IMetabaseObject;
    StandCub: IStandardCube;
    Man: IMatrixAggregatorManager;
    Dim: IStandardCubeDimension;
    Lvl: IDimLevels;
    ChronAggr: IChronologicalMatrixAggregator;
    LevAggr: IChronologicalMatrixLevelAggregator;
    Dest: IStandardCubeDestination;
Begin
    MB := MetabaseClass.Active;
    MObj := MB.ItemById("Std_Cube").Edit;
    StandCub := MObj As IStandardCube;
    //Create a new aggregator
    Man := New MatrixAggregatorManager.Create As IMatrixAggregatorManager;
    //Chronological aggregation mechanism
    ChronAggr := Man.CreateAggregator("ChronologicalMatrixAggregator"As IChronologicalMatrixAggregator;
    //For calendar dimension
    Dim := StandCub.Dimensions.FindById("CALENDAR");
    Lvl := Dim.Dimension.Levels;
    ChronAggr.Dimension := Dim.Dimension;
    //Source level
    LevAggr := ChronAggr.LevelAggregation(Lvl.Item(0));
    //Uniform  disaggregation method
    LevAggr.Operation := ChronologicalAggregatorOperation.UniformDisaggregation;
    //Destination level
    LevAggr.SourceLevel := Lvl.Item(1);
    //Set aggregation by the first element of fact dimension
    Dest := StandCub.Destinations.Item(0);
    Dim.Aggregator(1, Dest) := ChronAggr;
    MObj.Save;
End Sub Main;

After executing the example data aggregation is set up for the calendar dimension of a cube. Uniform data disaggregation is executed from the first level existing in the calendar dimension to the second level of the calendar. This aggregation method is set for the first element of fact dimension.

Example 2

Executing the example requires a standard cube with the Std_Cube identifier. The cube contains a dimension with the D_TO identifier containing several levels.

Sub Main;
Var
    MB: IMetabase;
    MObj: IMetabaseObject;
    StandCub: IStandardCube;
    Man: IMatrixAggregatorManager;
    Dim: IStandardCubeDimension;
    Lvl: IDimLevels;
    BasicAggr: IBasicMatrixAggregator;
    LevAggr: IBasicMatrixLevelAggregator;
    Dest: IStandardCubeDestination;
Begin
    MB := MetabaseClass.Active;
    MObj := MB.ItemById("Std_Cube").Edit;
    StandCub := MObj As IStandardCube;
    //Create a new aggregator
    Man := New MatrixAggregatorManager.Create As IMatrixAggregatorManager;
    //Main aggregation mechanism
    BasicAggr := Man.CreateAggregator("BasicMatrixAggregator"As IBasicMatrixAggregator;
    //For the D_TO dimension
    Dim := StandCub.Dimensions.FindById("D_TO");
    Lvl := Dim.Dimension.Levels;
    BasicAggr.Dimension := Dim.Dimension;
    //Destination level
    LevAggr := BasicAggr.LevelAggregation(Lvl.Item(Lvl.Count - 2));
    //Method of actual mean
    LevAggr.Operation := BasicAggregatorOperation.ActualMean;
    //Source level
    LevAggr.Include(Lvl.Item(Lvl.Count - 1)) := True;
    //Set aggregation by the first element of fact dimension
    Dest := StandCub.Destinations.Item(0);
    Dim.Aggregator(1, Dest) := BasicAggr;
    MObj.Save;
End Sub Main;

After executing the example data aggregation is set up for dimension of the D_TO cube. Data is aggregated from the last level to the last but one. Aggregation method is actual mean. This method of aggregation is set for the first element of fact dimension.

See also:

Examples