IDimHierarchies.FindById

Syntax

FindById(hierarchyId: String): IDimHierarchy;

Parameters

hierarchyId - alternative hierarchy ID.

Description

The FindById method searches for an alternative hierarchy in the collection by hierarchy identifier.

Example

Executing the example requires that the repository contains a dictionary with the TB_BASE identifier.

Sub Main;

Var

Mb: IMetabase;

OriginalModelObj: IMetabaseObject;

OriginalModel: IDimensionModel;

Hierarchies: IDimHierarchies;

Hierarchy: IDimHierarchy;

Begin

Mb := MetabaseClass.Active;

OriginalModelObj := Mb.ItemById("TB_BASE").Edit;

OriginalModel := OriginalModelObj As IDimensionModel;

Hierarchies := OriginalModel.Hierarchies;

Hierarchy := Hierarchies.FindById("SOURCE1");

If Hierarchy <> Null Then

Debug.WriteLine(" Name: " + Hierarchy.Name);

Debug.WriteLine(" Key: " + Hierarchy.Key.ToString);

End If;

End Sub Main;

After executing the example development environment console displays information on alternative hierarchy with the SOURCE1 identifier if the TB_BASE dictionary contains such a hierarchy.

See also:

IDimHierarchies