IAutoCubeDimension.AggregatorHierarchies

Syntax

AggregatorHierarchies(Destination: IAutoCubeDestination): IMatrixAggregatorModelHierarchies

AggregatorHierarchies[Destination: Prognoz.Platform.Interop.Cubes.IAutoCubeDestination]: Prognoz.Platform.Interop.Matrix.IMatrixAggregatorModelHierarchies

Parameters

Destination. Cube display version for which aggregation by alternative hierarchy levels must be set up.

Description

The AggregatorHierarchies property determines aggregation settings by levels of alternative hierarchy for the specified cube display option.

Example

To execute the example, make sure that the repository contains automatic cube with the CUBE identifier that uses dictionaries as alternative hierarchy.

Add links to the Metabase, Cubes, Dimensions, Matrix system assemblies.

Sub UserProc;
Var
    MB: IMetabase;
    Cub: IAutoCube;
    Hiers: IMatrixAggregatorModelHierarchies;
    AggHier: IBasicMatrixAggregator;
    Dim: IAutoCubeDimension;
    Dest: IAutoCubeDestination;
    HierKey: Integer;
Begin
    MB := MetabaseClass.Active;
    
// Get cube for edit
    Cub := MB.ItemById("CUBE").Edit As IAutoCube;
    
// Get the first cube dimensions
    Dim := Cub.Dimensions.Item(0);
    
// Get parameters of cube display version
    Dest := Cub.Destinations.Item(0);
    
// Get the list of alternative hierarchies
    Hiers := Dim.AggregatorHierarchies(Dest);
    
// Get settings of alternative hierarchy of the first dictionary in the list
    HierKey := Dim.Dimension.Hierarchies.Item(0).Key;
    AggHier := Hiers.Add(HierKey) 
As IBasicMatrixAggregator;
    
// Change aggregation parameters
    AggHier.UseSelection := True;
    AggHier.DefaultLevelAggregation.Operation := BasicAggregatorOperation.Sum;
    
// Save changes to cube
    (Cub As IMetabaseObject).Save;
End Sub UserProc;

Imports Prognoz.Platform.Interop.Metabase;
Imports Prognoz.Platform.Interop.Cubes;
Imports Prognoz.Platform.Interop.Dimensions;
Imports Prognoz.Platform.Interop.Matrix;

Public Shared Sub Main(Params: StartParams);
Var
    MB: IMetabase;
    Cub: IAutoCube;
    Hiers: IMatrixAggregatorModelHierarchies;
    AggHier: IBasicMatrixAggregator;
    Dim: IAutoCubeDimension;
    Dest: IAutoCubeDestination;
    HierKey: UInteger;
Begin
    MB := Params.Metabase;
    
// Get cube for edit
    Cub := MB.ItemById["CUBE"].Edit() As IAutoCube;
    
// Get the first cube dimensions
    Dim := Cub.Dimensions.Item[0];
    
// Get parameters of cube display version
    Dest := Cub.Destinations.Item[0];
    
// Get the list of alternative hierarchies
    Hiers := Dim.AggregatorHierarchies[Dest];
    
// Get settings of alternative hierarchy of the first dictionary in the list
    HierKey := Dim.Dimension.Hierarchies.Item[0].Key As UInteger;
    AggHier := Hiers.Add(HierKey) 
As IBasicMatrixAggregator;
    
// Change aggregation parameters
    AggHier.UseSelection := True;
    AggHier.DefaultLevelAggregation.Operation := BasicAggregatorOperation.baoSum;
    
// Save changes to cube
    (Cub As IMetabaseObject).Save();
End Sub;

After executing the example on setting up data aggregation of automatic cube with the CUBE identifier, there will be a change of parameters of the first dictionary of alternative hierarchy:

See also:

IAutoCubeDimension