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 DB server with the MDCalc_1 identifier. A data consumer is based on a calendar dimension with the CALEN identifier.
Sub Main;
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 with the help of Selection'a
Filter := Args.SliceFilter(MDInst.Calculation.Destination.Slices.FindById("CALEN"));
Filter.Type := MDCalculationSliceFilterType.Selection;
Filter.Selection.SelectElement(0, True);
Filter.Selection.SelectElement(32, True);
MDInst.Calculate(Args);
End Sub Main;
After executing the example multidimensional calculation is executed on DB server. Calculation is executed by the selected elements containing formulas.
See also: