CalculationMode: EaxDataAreaTransformationCalculationMode;
The CalculationMode property sets formula calculation for calculated elements in calculation chain.
The order of calculation elements formula calculation is set both before aggregation and totals calculation and between them. By default formulas of calculated elements are added to calculation chain before the Calculation Aggregation section and calculated in addition order.
NOTE. The totals calculation is executed only after aggregation calculation. Changing of formula calculation order in the Totals Calculation item may cause changing of totals result.
For details see the Calculated Elements section.
To execute the example, make sure that the repository contains an express report with the EXPRESS identifier. The report displays table and calculated elements are added to the dimension elements selection.
Add links to the Metabase and Express system assemblies.
Sub UserProc;
Var
MB: IMetabase;
Express: IEaxAnalyzer;
Slice: IEaxDataAreaSlice;
Trs: IEaxDataAreaTransformations;
Tr: IEaxDataAreaTransformation;
i: integer;
Begin
MB := MetabaseClass.Active;
Express := MB.ItemById("EXPRESS").Edit As IEaxAnalyzer;
// Get analytical data area slice
Slice := Express.DataArea.Slices.Item(0);
// Move all calculated elements before aggregation and totals calculation in calculation chain
Trs := Slice.CalcTransformations;
For i := 0 To trs.Count - 1 Do
Tr := Trs.Item(i);
Tr.CalculationMode := EaxDataAreaTransformationCalculationMode.AfterDataSourceExecute;
End For;
// Save changes
(Express As IMetabaseObject).Save;
End Sub UserProc;
Imports Prognoz.Platform.Interop.Metabase;
Imports Prognoz.Platform.Interop.Express;
…
Public Shared Sub Main(Params : StartParams);
Var
MB: IMetabase;
Express: IEaxAnalyzer;
Slice: IEaxDataAreaSlice;
Trs: IEaxDataAreaTransformations;
Tr: IEaxDataAreaTransformation;
i: integer;
Begin
MB := Params.Metabase;
Express := MB.ItemById["EXPRESS"].Edit() As IEaxAnalyzer;
// Get analytical data area slice
Slice := Express.DataArea.Slices.Item[0];
// Move all calculated elements before aggregation and totals calculation in calculation chain
Trs := Slice.CalcTransformations;
For i := 0 To trs.Count - 1 Do
Tr := Trs.Item[i];
Tr.CalculationMode := EaxDataAreaTransformationCalculationMode.edatcmAfterDataSourceExecute;
End For;
// Save changes
(Express As IMetabaseObject).Save();
End Sub;
After executing the example calculated elements will calculated before aggregation and totals calculation. The table will display values of all added calculated elements.
See also: