IEaxHierarchyGroupSettings.LevelNumber

Syntax

LevelNumber: Integer;

Description

The LevelNumber property determines level number of dimension for which elements grouping is enabled.

Comments

Level numbering starts with one. The property is set to 0 by default, all dimension elements are grouped.

If level is set, then elements of only this level are grouped. Superior levels elements create parent elements with saving the whole hierarchy. Child elements save their hierarchy towards elements of the specified level.

Example

Executing the example requires that the repository contains a regular report with the REPORT identifier. The report contains a data source, based on which an analytical data area is built. The dimension in the data area sidehead has several levels in its structure and an attribute with the GROUP identifier.

Add links to the Dimensions, Express, Metabase, Pivot, Report system assemblies.

Sub UserProc;
Var
    MB: IMetabase;
    Report: IPrxReport;
    Area: IEaxDataArea;
    Slice: IEaxDataAreaPivotSlice;
    Dim: IDimInstance;
    Hier: IEaxHierarchiesGroupSettings;
    HierGroup: IEaxHierarchyGroupSettings;
    Arr: Array 
Of Integer;
Begin
    
// Get repository
    MB := MetabaseClass.Active;
    
// Get regular report
    Report := MB.ItemById("REPORT").Edit As IPrxReport;
    
// Get analytical data area
    Area := Report.DataArea;
    
// Get analytical data area slice
    Slice := Area.Slices.Item(0As IEaxDataAreaPivotSlice;
    Dim := Slice.Pivot.LeftHeader.Dim(
0);
    
// Get properties of groupings collection
    Hier := Slice.EaxHierarchiesGroupSettings;
    
// Get grouping properties
    HierGroup := Hier.EaxHierarhyGroupSettings(Dim.Key);
    
// Change settings
    Arr := New Integer[1];
    Arr[
0] := Dim.Dimension.Attributes.FindById("GROUP").Key;
    HierGroup.Attributes := Arr;
    HierGroup.LevelNumber := 
2;
    
// Apply changes and save
    Report.Recalc;
    Report.MetabaseObject.Save;
End Sub UserProc;

After executing the example elements grouping for dimension from table data area sidehead is set up. First level elements will be grouped by specified attribute values.

See also:

IEaxHierarchyGroupSettings