Attributes: Array;
The Attributes property determines array of element attributes by which grouping is created.
Executing the example required that repository contains dictionary with the DIC identifier.
Add links to the Dimensions, Metabase system assemblies.
Sub UserProc;
Var
mb:IMetabase;
diminst:IDimInstance;
sel,sel_gr:IDimSelection;
creator: IDimHierarchyCreator;
ar: Array Of integer;
h_inst:IDimHierarchyInstance;
Begin
// Get repository
mb:=metabaseclass.Active;
// Open dictionary
diminst:=mb.ItemById("DIC").Open(Null) As IDimInstance;
// Get selection
sel:=diminst.CreateSelection;
sel.SelectElement(1, False);
sel.SelectElement(2, False);
// Display selected elements
debug.WriteLine(sel.ToString);
// Create a dynamically alternative hierarchy
creator := New DimHierarchyCreator.Create;
// Create an array, where place the attribute key, by which grouping is executed
ar:= New integer[1];
ar[0]:=1;
creator.Selection := sel;
// Send attribute, by which grouping is executed
creator.Attributes:=ar;
// Get grouping dimension
h_inst:=creator.HierarchyInstance;
sel_gr:=h_inst.Source.CreateSelection;
sel_gr.SelectAll;
// Display all elements of grouping hierarchy
debug.WriteLine(sel_gr.ToString);
End Sub UserProc;
After executing the example, the console displays all elements of alternative hierarchy with value of the attribute by which grouping is executed.
See also: