IEaxDataAreaTransformations.Arrange

Syntax

Arrange;

Description

The Arrange method automatically builds a transformation formula calculation chain according to their dependences.

Comments

On building a calculation chain the following criteria are taken into account:

According to the revealed dependences, transformation formulas are placed in the common calculation chain so that each formula calculation gives access to all required data. The value of the IEaxDataAreaTransformation.CalculationMode property is also automatically set for transformation formulas.

Example

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;
    Sub ShowCalulations(Calcs: IEaxDataAreaTransformations);
    Var
        Calc: IEaxDataAreaTransformation;
        i: Integer;
    Begin
        Debug.Indent;
        For i := 0 To Calcs.Count - 1 Do
            Calc := Calcs.Item(i);
            Debug.WriteLine(Calc.Expression.AsString + '(' + Calc.Element.ToString + ')');
        End For;
        Debug.Unindent;
    End Sub ShowCalulations;
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;
    //Data source 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("Formula calculation order before automatic arrangement of calculation chain:");
    ShowCalulations(CalcTrs);
    //Change formula
    CalcTr.Expression.AsString := "{Calculated_2[t]}";
    //Automatic arrangement of calculation chain
    CalcTrs.Arrange;
    Debug.WriteLine("Formula calculation order after automatic arrangement of calculation chain:");
    ShowCalulations(CalcTrs);
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 Arrange method enables the user to rebuild the whole calculation chain taking into account obtained dependency. The formulas order before and after building is displayed to the development environment. Expression for calculation and indexes of calculated elements in dimension will be displayed for formulas.

See also:

IEaxDataAreaTransformations