IDimAdditionalHierarchies.Add

Syntax

Add(New_:IDimHierarchy): IDimHierarchyInstance;

Parameters

New. Alternative dictionary hierarchy.

Description

The Add method adds additional alternative hierarchy in dimension.

Comments

To copy collection of additional alternative hierarchies from one dimension to another, use IDimAdditionalHierarchies.CopyFrom.

To clear collection of additional alternative hierarchies, use IDimAdditionalHierarchies.Clear.

To clear specified additional alternative hierarchy, use IDimAdditionalHierarchies.Remove, IDimAdditionalHierarchies.RemoveById, IDimAdditionalHierarchies.RemoveByKey.

Example

Executing the example requires that the repository have:

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

Sub UserProc;
Var
    MB: IMetabase;
    Express: IEaxAnalyzer;
    Slice: IEaxDataAreaSlice;
    OriginDim: IDimensionModel;
    Hiers: IDimHierarchies;
    Hier: IDimHierarchy;
    Sel, Sel_: IDimSelection;
    AdditHiers, AdditHiers_: IDimAdditionalHierarchies;
    HierInst: IDimHierarchyInstance;
Begin
    // Get repository
    MB := MetabaseClass.Active;
    //Get structure of the main dictionary
    OriginDim := MB.ItemByIdNamespace("DIC_RF", MB.ItemById("RDS").Key).Edit As IDimensionModel;
    // Get dictionary hierarchy
    Hiers := OriginDim.Hierarchies;
    Hier := Hiers.Item(0);
    // Get express report
    Express := MB.ItemById("EXPRESS").Edit As IEaxAnalyzer;
    // Get data slice
    Slice := Express.DataArea.Slices.Item(0);
    // Add alternative hierarchies to the dimension
    Sel := Slice.Selection.FindById("DIC_RFD");
    AdditHiers := Sel.AdditionalHierarchies;
    HierInst := AdditHiers.Add(Hier);
    Sel_ := Slice.Selection.FindById("DIC_RFDR");
    AdditHiers_ := Sel.AdditionalHierarchies;
    AdditHiers.CopyFrom(AdditHiers_);
    // Refresh report and save changes
    Express.RefreshAll;
    (Express As IMetabaseObject).Save;
End Sub UserProc;

After executing the example additional alternative hierarchies will be added to the dimension.

See also:

IDimAdditionalHierarchies