IEaxDataAreaHierarchies.FindByDE

Syntax

FindByDE(S: IDimSelection; Key: Integer; de: Integer): IEaxDataAreaTransformation;

Parameters

S. Dimension where alternative hierarchy is placed

Key. Key of the dimension

de. Dimension element.

Description

The FindByDE method searches data transformation formula by dimension element index.

Comments

If formula is not found, the method returns Null.

To search data transformation formula by dimension element identifier, use IEaxDataAreaHierarchies.Find.

Example

Executing the example requires that the repository contains an express report with the EXPRESS identifier. The report contains a table.

Add links to the Dimensions, Express, Metabase system assemblies.

Sub UserProc;
Var
    MB: IMetabase;
    Express: IEaxAnalyzer;
    Hiers: IEaxDataAreaHierarchies;
    Slice: IEaxDataAreaSlice;
    DimSel: IDimSelection;
    Tr, TrDE: IEaxDataAreaTransformation;
Begin
    // Get repository
    MB := MetabaseClass.Active;
    // Get express report
    Express := MB.ItemById("EXPRESS").Bind As IEaxAnalyzer;
    // Get data source slice
    Slice := Express.DataArea.Slices.Item(0);
    //Get dimension selection
    DimSel := Slice.Selection.Item(3);
    Hiers := Express.DataArea.Hierarchies;
    Tr := Hiers.FindByDE(DimSel, Dimsel.Dimension.Key, DimSel.Element(3));
    TrDE := Hiers.Find(DimSel, Dimsel.Dimension.Key, "Moscow");
    If Tr = Null Then
        Debug.WriteLine("Alternative hierarchy does not contain data transformation formula"Else
        Debug.WriteLine("Data transformation formula = " + Tr.Expression.AsString);
    End If;
    If TrDE = Null Then
        Debug.WriteLine("Alternative hierarchy does not contain data transformation formula"Else
        Debug.WriteLine("Data transformation formula is removed = " + TrDE.Expression.AsString);
        Hiers.RemoveDependant(DimSel, Dimsel.Dimension.Key, "Moscow", TrDE);
    End If;
End Sub UserProc;

After executing the example, the console displays data transformation of alternative hierarchy. If transformation formula is found by dimension element identifier, it will be removed.

See also:

IEaxDataAreaHierarchies