IDimElementsIndent.IndentName

Syntax

IndentName(Element: Integer; Indent: Integer): String;

Parameters

Element - element of composite dimension.

Indent - index of the dimension on changing which the name of Element element was formed.

Description

The IndentName property returns name of source dimension element used to generate name for the Element element.

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 UserProc;
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;
    //Create selection for opening 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;
        //Create selection according to fixed dimensions selection in data 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 composite dimension elements
    Elements := (CDimInst As IDimInstance).Elements;
    ElementsInd := Elements As IDimElementsIndent;
    //Display information about creating 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 UserProc;

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