Express > Express Assembly Interfaces > IEaxDataAreaTransformation > IEaxDataAreaTransformation.Transform
Transform: Object;
The Transform property returns object to work with parameters of data transformation formula.
To work with the object returned by this property, it must be transformed to the IMsFormulaTransform interface.
Executing the example requires that the repository contains an express report with the EXPRESS identifier that contains the formula edited in the expression editor.
Add links to the Dimension, Express, Metabase, Ms, Pivot system assemblies.
Sub UserProc;
Var
MB: IMetabase;
Express: IEaxAnalyzer;
DArea: IEaxDataArea;
DAreaSlice: IEaxDataAreaSlice;
CalcTransformations: IEaxDataAreaTransformations;
CalcTransformation: IEaxDataAreaTransformation;
Transform: IMsFormulaTransform;
GeneratedName: String;
FormulaCount: Integer;
Formula: IMSFormula;
Gen: IMsFormulaStringGenerator;
SelSet: IDimSelectionSet;
Begin
// Get repository
MB := MetabaseClass.Active;
// Get express report
Express := MB.ItemById("EXPRESS").Edit As IEaxAnalyzer;
// Get data source slice
DArea := Express.DataArea;
DAreaSlice := DArea.Slices.Item(0);
// Get analytical area data transformation formula
CalcTransformations := DAreaSlice.CalcTransformations;
CalcTransformation := CalcTransformations.Item(0);
// Set selection and dimension key
SelSet := Express.Pivot.Selection;
CalcTransformation.Selection := SelSet;
CalcTransformation.DimKey := Express.Pivot.DimItem(0).Key;
// Display in the console
Debug.WriteLine("Element value - " + CalcTransformation.Element.ToString);
Debug.WriteLine("Element identifier - " + CalcTransformation.ElementId);
Debug.WriteLine("Transformation formula key - " + CalcTransformation.Key.ToString);
// Get and display generated formula name in the console
GeneratedName := CalcTransformation.GeneratedName;
Debug.WriteLine("Generated formula name - " + GeneratedName);
// Display scale of the current measurement unit in the console
Debug.WriteLine("Measurement unit scale: " + CalcTransformation.DefaultUnit.ToString);
// Set formula name
CalcTransformation.Name := "TransformFormula";
// Display the number of formula calculation methods in the console window
Transform := CalcTransformation.Transform As IMsFormulaTransform;
FormulaCount := Transform.FormulaCount;
Debug.WriteLine("Number of calculation methods - " + FormulaCount.ToString);
// Get and display calculation method name in the console window
Formula := Transform.FormulaItem(0);
Gen := Formula.CreateStringGenerator;
Gen.ShowFullVariableNames := True;
Debug.WriteLine("Calculation method name - " + Gen.Execute);
// Save changes
(Express As IMetabaseObject).Save;
End Sub UserProc;
After executing the example:
The console displays generated name of data transformation formula, calculated element value, its identifier, transformation formula key.
Formula name is changed.
The console displays dimension unit scale.
The console displays number of formula calculation methods.
The console window displays the name of the formula calculation method.
See also: