ArrangeTransformation(Value: IEaxDataAreaTransformation);
ArrangeTransformation(Value: Prognoz.Platform.Interop.Express.IEaxDataAreaTransformation);
Value. Data transformation formula.
The ArrangeTransformation method determines a place of the specified transformation formula in calculation chain according to its dependences.
On determining a place in the calculation chain the method uses the same algorithm and the same criteria as the IEaxDataAreaTransformations.Arrange method. The difference is that method is executed only for one specified transformation formula.
To automatically arrange all transformation formulas in the calculation chain, use the IEaxDataAreaTransformations.Arrange method.
Executing the example requires that the repository contains express report with the EXPRESS identifier. In the row dimension create two calculated elements with the following names: Calculated_1, Calculated_2. Arbitrary formulas are set for calculated elements. This dimension is built basing on the dictionary which is not calendar.
Connect the Express, Metabase system assemblies.
Sub UserProc;
Var
MB: IMetabase;
Express: IEaxAnalyzer;
DArea: IEaxDataArea;
Slice: IEaxDataAreaSlice;
CalcTrs: IEaxDataAreaTransformations;
CalcTr: IEaxDataAreaTransformation;
Begin
//Get repository
MB := MetabaseClass.Active;
//Get express report
Express := MB.ItemById("EXPRESS").Edit As IEaxAnalyzer;
//Analytical data area slice
DArea := Express.DataArea;
Slice := DArea.Slices.Item(0);
//Data transformation formulas in analytical area
CalcTrs := Slice.CalcTransformations;
//Get transformation formula and change its expression
CalcTr := CalcTrs.Item(0);
Debug.WriteLine("Index in calculation chain before automatic arrangement: " + CalcTrs.IndexOf(CalcTr).ToString);
//Change formula
CalcTr.Expression.AsString := "{Calculated_2[t]}";
//Automatic arrangement of calculation chain
CalcTrs.ArrangeTransformation(CalcTr);
Debug.WriteLine("Index in calculation chain after automatic arrangement: " + CalcTrs.IndexOf(CalcTr).ToString);
End Sub UserProc;
On executing the example transformation formula will be modified for the first calculated element - a new formula will get the value of the second calculated element. Calling the ArrangeTransformation method enables the user to rebuild the whole calculation chain taking into account obtained dependency. Transformation formula indexes in the calculation chain before and after changing the expression are displayed in the development environment console.
The requirements and result of the Fore.NET Example execution match with those in the Fore Example.
Imports Prognoz.Platform.Interop.Express;
Imports Prognoz.Platform.Interop.Metabase;
Public Shared Sub Main(Params: StartParams);
Var
MB: IMetabase;
Express: IEaxAnalyzer;
DArea: IEaxDataArea;
Slice: IEaxDataAreaSlice;
CalcTrs: IEaxDataAreaTransformations;
CalcTr: IEaxDataAreaTransformation;
Begin
//Get repository
MB := Params.Metabase;
//Get express report
Express := MB.ItemById["EXPRESS"].Edit() As IEaxAnalyzer;
//Analytical data area slice
DArea := Express.DataArea;
Slice := DArea.Slices.Item[0];
//Data transformation formulas in analytical area
CalcTrs := Slice.CalcTransformations;
//Get transformation formula and change its expression
CalcTr := CalcTrs.Item[0];
System.Diagnostics.Debug.WriteLine("Index in calculation chain before automatic arrangement: " + CalcTrs.IndexOf(CalcTr).ToString());
//Change formula
CalcTr.Expression.AsString := "{Calculated_2[t]}";
//Automatic arrangement of calculation chain
CalcTrs.ArrangeTransformation(CalcTr);
System.Diagnostics.Debug.WriteLine("Index in calculation chain after automatic arrangement: " + CalcTrs.IndexOf(CalcTr).ToString());
End Sub;
See also: