Selection: IDimSelection;
The Selection property determines selection of elements used in calculation.
It is relevant if the Type property is set to MDCalculationSliceFilterType.Selection.
Executing the example requires that the repository contains multidimensional calculation on database server with the MDCalc_1 identifier. A data consumer is based on a calendar dimension with the CALENDAR identifier.
Sub UserProc;
Var
MB: IMetabase;
MDInst: IMDCalculationInstance;
Args: IMDCalculationCalculateArgs;
Filter: IMDCalculationSliceFilter;
Begin
MB := MetabaseClass.Active;
MDInst := MB.ItemById("MDCalc_1").Open(Null) As IMDCalculationInstance;
Args := MDInst.CreateCalculateArgs;
//filter using Selection
Filter := Args.SliceFilter(MDInst.Calculation.Destination.Slices.FindById("CALENDAR"));
Filter.Type := MDCalculationSliceFilterType.Selection;
Filter.Selection.SelectElement(0, True);
Filter.Selection.SelectElement(32, True);
MDInst.Calculate(Args);
End Sub UserProc;
After executing the example multidimensional calculation is executed on DB server. Calculation is executed by the selected elements containing formulas.
See also: