ICalcAggr.Aggregator

Syntax

Aggregator(DimModel: IDimensionModel): IBasicMatrixAggregator;

None;

Parameters

DimModel. Dictionary structure.

Description

The Aggregator property returns basic aggregation mechanism settings.

Example

Executing the example requires that the repository contains a calculation algorithm with the ALGORITHM identifier and a standard cube with the CUBE identifier. The calculation algorithm should contain an aggregation block, the cube should contain a dimension with the DIMENSIONS identifier.

Add a link the Calculation Algorithm Core custom assembly contained in the Calculation Algorithms component, and links to the Algo, Cubes, Dimensions, Matrix, Metabase system assemblies.

Sub UserProc;
Var
    MB: IMetabase;
    MObj: IMetabaseObjectDescriptor;
    Algo, Aggr: ICalcObject;
    List: ICalcObjectsList;
    CalcAlgo: ICalcAlgorithm;
    Block: ICalcAggr;
    Stub: IVariableStub;
    StandCub: IStandardCube;
    Dim: IStandardCubeDimension;
    Lvl: IDimLevels;
    BasicAggr: IBasicMatrixAggregator;
    LevAggr: IBasicMatrixLevelAggregator;
Begin
    MB := MetabaseClass.Active;
    
// Get calculation algorithm
    MObj := MB.ItemById("ALGORITHM");
    Algo := CalcObjectFactory.CreateCalcObject(MObj, 
True);
    CalcAlgo := Algo 
As ICalcAlgorithm;
    
// Get list of calculation algorithm objects
    List := CalcAlgo.Items;
    
// Get aggregation block with the 0 index
    Aggr := List.Item(0);
    Block := Aggr 
As ICalcAggr;
    
// Get cube
    StandCub := MB.ItemById("CUBE").Edit As IStandardCube;
    Stub := StandCub 
As IVariableStub;
    
// Set cube as data consumer
    Block.Stub := Stub;
    
// Set up basic aggregation mechanism for specified dimension
    Dim := StandCub.Dimensions.FindById("DIMENSIONS");
    BasicAggr := Block.Aggregator(Dim.Dimension);
    
// Get dimension levels
    Lvl := Dim.Dimension.Levels;
    
// Set parameters for default level
    LevAggr := BasicAggr.DefaultLevelAggregation;
    LevAggr.Operation := BasicAggregatorOperation.ArithmeticalMean;
    LevAggr.PreserveExistingData := 
True;
    LevAggr.PreserveMethod := ExistingDataPreserveMethod.OnNull;
    
// Save changes in aggregation block
    Block.Save;
End Sub UserProc;

Not provisioned.

After executing the example, a standard cube is set as a data consumer for the aggregation block, and data aggregation is set up for the dimension with the DIMENSIONS identifier.

See also:

ICalcAggr