Clear(Value: IDimSelection; Key: Integer);
Clear(Value: Prognoz.Platform.Interop.Dimensions.IDimSelection; Key: uinteger);
Value. Dimension selection where alternative hierarchy is placed.
Key. Dimension key.
The Clear method removes collection of alternative hierarchies from specified dimension.
To clear collections from analytical data area, use IEaxDataAreaHierarchies.ClearAll.
To add alternative hierarchy to collection, use IEaxDataAreaHierarchies.Add.
Executing the examplerequires that the repository contains express report with the EXPRESS identifier. One of report dimensions must contain at least one alternative hierarchy.
Add links to the Dimensions, Express, Metabase system assemblies.
Sub UserProc;
Var
MB: IMetabase;
Express: IEaxAnalyzer;
Hiers: IEaxDataAreaHierarchies;
Slice: IEaxDataAreaSlice;
DimSel: IDimSelection;
Begin
// Get repository
MB := MetabaseClass.Active;
// Get express report
Express := MB.ItemById("EXPRESS").Edit As IEaxAnalyzer;
// Get data source slice
Slice := Express.DataArea.Slices.Item(0);
//Get dimension selection
DimSel := Slice.Selection.Item(0);
// Remove alternative hierarchy from dimension
Hiers := Express.DataArea.Hierarchies;
Hiers.Clear(DimSel, DimSel.Dimension.Key);
(Express As IMetabaseObject).Save;
End Sub UserProc;
After executing the example all alternative hierarchies will be removed from specified dimension.
The requirements and result of the Fore.NET Example execution match with those in the Fore Example.
Imports Prognoz.Platform.Interop.Dimensions;
Imports Prognoz.Platform.Interop.Express;
…
Public Shared Sub Main(Params: StartParams);
Var
MB: IMetabase;
Express: IEaxAnalyzer;
Hiers: IEaxDataAreaHierarchies;
Slice: IEaxDataAreaSlice;
DimSel: IDimSelection;
Begin
// Get repository
MB := Params.Metabase;
// Get express report
Express := MB.ItemById["EXPRESS"].Edit() As IEaxAnalyzer;
// Get data source slice
Slice := Express.DataArea.Slices.Item[0];
//Get dimension selection
DimSel := Slice.Selection.Item[0];
// Remove alternative hierarchy from dimension
Hiers := Express.DataArea.Hierarchies;
Hiers.Clear(DimSel, DimSel.Dimension.Key);
(Express As IMetabaseObject).Save();
End Sub;
See also: