DimHierarchy: IDimHierarchyInstance;
The DimHierarchy property determines attribute hierarchy.
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.
Executing the example requires a form, a button named Button1 on the form and the MetaAttributesBreadcrumb component named MetaAttributesBreadcrumb1. The repository must contain a time series database with the DIM_HIERARCHY identifier. The database must contain a custom attribute referring to the dictionary with configured alternative hierarchy. At least one dictionary element must be selected for the MetaAttributesBreadcrumb1 component. The example is a handler of the OnClick event for the Button1 component.
Add links to the Cubes, Dimensions, ExtCtrls, Forms, Metabase, and Rds system assemblies.
Sub SAMPLEFormOnCreate(Sender: Object; Args: IEventArgs);
Var
MB: IMetabase;
RubInst: IRubricatorInstance;
Begin
MB := MetabaseClass.Active;
RubInst := MB.ItemById("DIM_HIERARCHY").Open(Null) As 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(0) As IMetaAttributeBreadcrumbItem;
Attr := Item.MetaAttribute;
DimInst := Attr.ValuesObject.Open(Null) As 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:
Before applying the alternative hierarchy:
.
After applying the alternative hierarchy:
.
See also: