HierarchyLevels(Cube: String; Dimension: String; Hierarchy: String; Level: String): IDalCursor;
Cube. Physical name of the cube.
Dimension. Dictionary physical name.
Hierarchy. Dictionary hierarchy name.
Level. Dictionary hierarchy level.
The HierarchyLevels method returns the cursor that contains system information about specified dictionary hierarchy level.
The obtained cursor contains information about all the hierarchies' levels of all the dictionaries contained in the ADOMD catalog if the Cube, Dimension, Hierarchy, and Level parameters are not specified. The cursor with information about one or several levels is obtained depending on what parameters are specified.
A specific record is added to the cursor to divide information by levels. First field in this record has no name and the level number is used as the field value.
Executing the example requires that the repository contains an ADOMD catalog with the ADOMDTest identifier. A cube with the Test physical name is contained in this catalog and a dictionary with the Dim_1 name is the part of this cube structure.
Sub UserProc;
Var
MB: IMetabase;
Catalog: IAdoMdCatalogInstance;
Connection: IAdoMdConnection;
HieLvl: IDalCursor;
CFields: IDalCursorFields;
CField: IDalCursorField;
i: Integer;
Begin
MB := MetabaseClass.Active;
Catalog := MB.ItemById("ADOMDTest").Open(Null) As IAdoMdCatalogInstance;
Connection := Catalog.Connection;
HieLvl := Connection.HierarchyLevels("Test", "Dim_1", "", "");
CFields := HieLvl.Fields;
While Not HieLvl.Eof Do
For i := 0 To CFields.Count - 1 Do
CField := CFields.Item(i);
Debug.WriteLine(CField.Name + " | " + CField.Value);
End For;
HieLvl.Next;
End While;
End Sub UserProc;
The cursor containing information about all levels all of hierarchies of the specified ADOMD dictionary is obtained on executing the example. This information is displayed in the development environment console.
See also: