IMetaAttributeSetting.DimHierarchy

Fore Syntax

DimHierarchy: IDimHierarchyInstance;

Fore.NET Syntax

DimHierarchy: IDimHierarchyInstance;

Description

The DimHierarchy property determines attribute hierarchy.

Comments

Use the IMetaAttributeSetting.ShowAttribute property to determine whether the specified MDM dictionary attribute is visible in the drop-down list of values of time series database attribute.

Fore Example

Executing the example requires a form, a button named Button1 positioned on this form and the MetaAttributesBreadcrumb component named MetaAttributesBreadcrumb1. The repository should contain a time series database with the DIM_HIERARCHY identifier. The base should contain a custom attribute referring to the dictionary with built-in alternative hierarchy. At least one dictionary element should be selected for the MetaAttributesBreadcrumb1 component. The example is the OnClick event handler for the Button1 component. Connect the Cubes, Dimensions, ExtCtrls, Forms, Rds system assemblies.

Add links to the Metabase and Dimensions system assemblies.

Sub SAMPLEFormOnCreate(Sender: Object; Args: IEventArgs);
Var
    MB: IMetabase;
    RubInst: IRubricatorInstance;
Begin
    MB := MetabaseClass.Active;
    RubInst := MB.ItemById("DIM_HIERARCHY").Open(NullAs IRubricatorInstance;
    MetaAttributesBreadcrumb1.Rubricator := RubInst;
End Sub SAMPLEFormOnCreate;

Sub Button1OnClick(Sender: Object; Args: IMouseEventArgs);
Var
    Items: IBreadcrumbItems;
    Item: IMetaAttributeBreadcrumbItem;
    Attr: IMetaAttribute;
    AttrS: IMetaAttributeSettings;
    AttrSett: IMetaAttributeSetting;
    DimInst: IDimInstance;
Begin
    Items := MetaAttributesBreadcrumb1.Items;
    Item := Items.Item(0As IMetaAttributeBreadcrumbItem;
    Attr := Item.MetaAttribute;
    DimInst := Attr.ValuesObject.Open(NullAs IDimInstance;
    AttrS := MetaAttributesBreadcrumb1.MetaAttributeSettings;
    AttrSett := AttrS.FindByAttribute(Attr);
    AttrSett.DimHierarchy := DimInst.Hierarchies.Item(0);
End Sub Button1OnClick;

After executing the example the alternative hierarchy is applied to the displayed dictionary elements:

Fore.NET Example

The requirements and result of the Fore.NET Example execution match with those in the Fore Example. Use Fore.NET analogs instead of Fore components.

Imports Prognoz.Platform.Interop.Cubes;
Imports Prognoz.Platform.Interop.Dimensions;
Imports Prognoz.Platform.Interop.ExtCtrls;
Imports Prognoz.Platform.Interop.Forms;
Imports Prognoz.Platform.Interop.Rds;

Private Sub SAMPLEForm_Load(sender: System.Object; e: System.EventArgs);
Var
    MB: IMetabase;
    RubInst: IRubricatorInstance;
Begin
    MB := Self.Metabase;
    RubInst := MB.ItemById["DIM_HIERARCHY"].Open(NullAs IRubricatorInstance;
    metaAttributesBreadcrumbNet1.Rubricator := RubInst;
End Sub;

Private Sub button1_Click(sender: System.Object; e: System.EventArgs);
Var
    Items: IBreadcrumbItems;
    Item: IMetaAttributeBreadcrumbItem;
    Attr: IMetaAttribute;
    AttrS: IMetaAttributeSettings;
    AttrSett: IMetaAttributeSetting;
    DimInst: IDimInstance;
Begin
    Items := metaAttributesBreadcrumbNet1.CtrlBox.Items;
    Item := Items.Item[0As IMetaAttributeBreadcrumbItem;
    Attr := Item.MetaAttribute;
    DimInst := Attr.ValuesObject.Open(NullAs IDimInstance;
    AttrS := metaAttributesBreadcrumbNet1.CtrlBox.MetaAttributeSettings;
    AttrSett := AttrS.FindByAttribute(Attr);
    AttrSett.DimHierarchy := DimInst.Hierarchies.Item[0];
End Sub;

See also:

IMetaAttributeSetting