SQL: String;
The SQL property determines the SQL condition that is used to select elements, by which calculation is executed in the selected dimension.
It is relevant if the Type property is set to MDCalculationSliceFilterType.SQL.
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 by means of SQL condition
Filter := Args.SliceFilter(MDInst.Calculation.Destination.Slices.FindById("CALENDAR"));
Filter.Type := MDCalculationSliceFilterType.SQL;
Filter.SQL := "%0:s >= TO_DATE('2025.01.01', 'YYYY.MM.DD') AND %0:s <= TO_DATE('2026.01.01', 'YYYY.MM.DD')";
MDInst.Calculate(Args);
End Sub UserProc;
After executing the example multidimensional calculation is executed on DB server. Calculation is executed by elements that contain formulas and that are located during 2025-2026.
See also: