MoveToNew(Attribute: IMetaAttribute; LevelBefore: IMetaHierarchyLevel): IMetaHierarchyLevel;
Attribute - attribute that should be moved in the separate level.
LevelBefore - hierarchy level, before which it is necessary to create the level.
The MoveToNew method selects the attribute in the separate level.
Executing the example requires that the repository contains a time series database with the OBJ_FC identifier.
Add links to the Cubes, Metabase, Rds system assemblies.
Sub UserProc;
Var
Mb: Imetabase;
Rubr: IRubricator;
Facts: IMetaDictionary;
Hierarchy: IMetaHierarchy;
HAttributes: IMetaHierarchyAttributes;
Att: IMetaAttribute;
HLev: IMetaHierarchyLevel;
Begin
Mb := MetabaseClass.Active;
Rubr := MB.ItemById("OBJ_FC").Bind As IRubricator;
Facts := Rubr.Facts;
Hierarchy := Facts.DefaultHierarchy;
HAttributes := Hierarchy.Attributes;
Att := Facts.Attributes.FindById("REV");
HLev := HAttributes.MoveToNew(Att, Hierarchy.Levels.Leaf);
End Sub UserProc;
After executing the example the REV indicator attribute is moved in the separate level of the hierarchy. The created level is put before the leaf level of the hierarchy.
See also: