FindByDE(S: IDimSelection; Key: Integer; de: Integer): IEaxDataAreaTransformation;
FindByDE(S: Prognoz.Platform.Interop.Dimensions.IDimSelection;
Key: uinteger;
de: uinteger): Prognoz.Platform.Interop.Express.IEaxDataAreaTransformation;
S. Dimension where alternative hierarchy is placed
Key. Key of the dimension
de. Dimension element.
The FindByDE method searches data transformation formula by dimension element index.
If formula is not found, the method returns Null.
To search data transformation formula by dimension element identifier, use IEaxDataAreaHierarchies.Find.
Executing the examplerequires that the repository contains express report with the EXPRESS identifier. The report contains 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.
The requirements and result of the Fore.NET Example execution match with those in the Fore Example.
Imports Prognoz.Platform.Interop.Dimensions;
Imports Prognoz.Platform.Interop.Express;
…
Public Shared Sub Main(Params: StartParams);
Var
MB: IMetabase;
Express: IEaxAnalyzer;
Hiers: IEaxDataAreaHierarchies;
Slice: IEaxDataAreaSlice;
DimSel: IDimSelection;
Tr, TrDE: IEaxDataAreaTransformation;
Begin
// Get repository
MB := Params.Metabase;
// 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
System.Diagnostics.Debug.WriteLine
("Alternative hierarchy does not contain data transformation formula") Else
System.Diagnostics.Debug.WriteLine("Data transformation formula = " + Tr.Expression.AsString);
End If;
If TrDE = Null Then
System.Diagnostics.Debug.WriteLine
("Alternative hierarchy does not contain data transformation formula") Else
System.Diagnostics.Debug.WriteLine
("Data transformation formula is removed = " + TrDE.Expression.AsString);
Hiers.RemoveDependant(DimSel, Dimsel.Dimension.Key, "Moscow", TrDE);
End If;
End Sub;
See also: