IDimElementsIndent.IndentLow

Syntax

IndentLow(Element: Integer): Integer;

Parameters

Element - composite dimension element.

Description

The IndentLow property returns index of the dimension element of which was used to form name of the Element element in a composite dimension.

This property can return the following values:

NOTE. Element name is generated by changing name of the previous element of the same level. If this element contains no more element, name of the last element on the previous level is changed.

NOTE. If the composite dictionary has only one source, source name is not used to generate element names.

Example

Executing the example requires that the repository contains a virtual cube with the Virt_Cube identifier. Cubes named Cube 1 and Cube 2 are used as data sources for this virtual cube. The first cube has three dimensions, the second one has two dimensions. Elements of each dimension have numeric names from 1 to n.

Sub Main;

Var

MB: IMetabase;

Cube: IVirtualCube;

Sources: IVirtualCubeSources;

CDim: ICompoundDimension;

CSource: ICompoundDimensionSource;

CSel, Sel: IDimSelectionSet;

FixInfo: ICubeDimensionFixInfo;

Fix: ICubeDimensionFix;

Params: IMetabaseObjectParamValues;

CDimInst: ICompoundDimensionInstance;

Elements: IDimElements;

ElementsInd: IDimElementsIndent;

Element: Integer;

Begin

MB := MetabaseClass.Active;

Cube := MB.ItemById("Virt_Cube").Bind As IVirtualCube;

Sources := Cube.Sources;

//Forming selection to open composite dimension

CDim := Cube.FactDimension As ICompoundDimension;

Sel := (New DimSelectionSetFactory.Create).CreateDimSelectionSet;

CSel := (New DimSelectionSetFactory.Create).CreateDimSelectionSet;

For Each CSource In CDim.Sources Do

Sel.Clear;

//Forming selection in accordance with selection of fixed dimension in the sources

FixInfo := Sources.FindByKey(CSource.Key).FixInfo;

For Each Fix In FixInfo Do

If Fix.Selection.SelectedCount <> 0 Then

Fix.Selection.CopyTo(Sel.Add(Fix.Instance), True);

End If;

End For;

CSel.AddCompound(CSource.Key, Sel);

End For;

//Open composite dimension

Params := (CDim As IMetabaseObject).Params.CreateEmptyValues;

Params.FindById("SELECTIONS").Value := CSel;

CDimInst := (CDim As IMetabaseObject).Open(Params) As ICompoundDimensionInstance;

//Get elements of composite dimension

Elements := (CDimInst As IDimInstance).Elements;

ElementsInd := Elements As IDimElementsIndent;

//Show information on forming element names

For Each Element In Elements.Elements Do

Debug.Write(Elements.Name(Element) + ": ");

Debug.Write("Dimension: " + ElementsInd.IndentLow(Element).ToString + " ");

Debug.WriteLine("Used element: " + ElementsInd.IndentName(Element, ElementsInd.IndentLow(Element)));

End For;

End Sub Main;

On executing this example to open composite dimension of the virtual cube, a selection is set based on selection of fixed dimensions in all cube's data sources. Development environment console displays names of composite dictionary elements and information on name generation.

Cube 1 - 1 - 1 - 1: Dimension: 0 Used element: Cube 1

Cube 1 - 1 - 1 - 2: Dimension: 3 Used element: 2

Cube 1 - 1 - 2 - 1: Dimension: 2 Used element: 2

Cube 1 - 1 - 2 - 2: Dimension: 3 Used element: 2

Cube 1 - 2 - 1 - 1: Dimension: 1 Used element: 2

Cube 1 - 2 - 1 - 2: Dimension: 3 Used element: 2

Cube 1 - 2 - 2 - 1: Dimension: 2 Used element: 2

Cube 1 - 2 - 2 - 2: Dimension: 3 Used element: 2

Cube 2 - 1 - 1: Dimension: 0 Used element: Cube 2

Cube 2 - 1 - 2: Dimension: 2 Used element: 2

Cube 2 - 1 - 3: Dimension: 2 Used element: 3

Cube 2 - 2 - 1: Dimension: 1 Used element: 2

Cube 2 - 2 - 2: Dimension: 2 Used element: 2

Cube 2 - 2 - 3: Dimension: 2 Used element: 3

This data can be explained as follows:

See also:

IDimElementsIndent