HasHierarchy: Boolean;
HasHierarchy: boolean;
The HasHierarchy property determines whether attribute is used as alternative hierarchy.
Available values:
True. Attribute is used as alternative hierarchy;
False. Attribute is not used as alternative hierarchy.
Executing the example requires that repository contains cube with the CUBE_SEP_PARAMS identifier. Determine list of facts and its hierarchy for cube without using existing dictionary.
Add links to the Cubes, Dimensions, Metabase system assemblies.
Sub UserProc;
Var
mb: IMetabase;
cube: IStandardCube;
customdim: ICustomDimension;
attrs: ICustomDimAttributes;
attr: ICustomDimAttribute;
Begin
// Get repository
mb := MetabaseClass.Active;
// Get cube
cube := mb.ItemById("CUBE_SEP_PARAMS").Edit As IStandardCube;
// Get facts dimension
customdim := cube.FactDimension.Dimension As ICustomDimension;
// Get collection of dimension attributes
attrs := customdim.Attributes;
// Get the Order facts dimension attribute
attr := attrs.Order;
// Set attribute as alternative hierarchy
attr.HasHierarchy := True;
// Save changes
(customDim As IMetabaseObject).Save;
End Sub UserProc;
After executing the example facts dimension will be used as alternative hierarchy.
The requirements and result of the Fore.NET example execution match with those in the Fore Example.
Imports Prognoz.Platform.Interop.Cubes;
Imports Prognoz.Platform.Interop.Dimensions;
…
Public Shared Sub Main(Params: StartParams);
Var
mb: IMetabase;
cube: IStandardCube;
customdim: ICustomDimension;
attrs: ICustomDimAttributes;
attr: ICustomDimAttribute;
Begin
// Get repository
mb := Params.Metabase;
// Get cube
cube := mb.ItemById["CUBE_SEP_PARAMS"].Edit() As IStandardCube;
// Get facts dimension
customdim := cube.FactDimension.Dimension As ICustomDimension;
// Get collection of dimension attributes
attrs := customdim.Attributes;
// Get the Order facts dimension attribute
attr := attrs.Order;
// Set attribute as alternative hierarchy
attr.HasHierarchy := True;
// Save changes
(customDim As IMetabaseObject).Save();
End Sub;
See also: