Show contents 

Express > Express Assembly Interfaces > IEaxDataAreaTransformations > IEaxDataAreaTransformations.Arrange

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 an 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. The dimension is built based on the dictionary that 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;

After executing the example transformation formula is modified for the first calculated element, and a new formula gets 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