IMsFormulaStringGenerator.Formula

Syntax

Formula: IMsFormula;

Description

The Formula property returns parameters of the method used for model calculation.

Example

Executing the example requires that the repository contains a form, a button named Button1 on it, the LanerBox component and the UiErAnalyzer component named UiErAnalyzer1 that is a data source for LanerBox. Workbook of the time series database must be loaded to UiErAnalyzer1. The first series of the workbook must be calculated.

The example is a handler of the OnClick event for the Button1 button.

Add links to the Cubes, Dimensions, and Ms system assemblies.

Sub Button1OnClick(Sender: Object; Args: IMouseEventArgs);
Var
    Laner: ILaner;
    Series: ILanerSeries;
    CalcSerie: ILanerCalculateSerie;
    TransformModel: IFormulaTransformModel;
    FormulaTransform: IMsFormulaTransform;
    Formula: IMsFormula;
    StringGenerator: IMsFormulaStringGenerator;
    s: String;
Begin
    Laner := UiErAnalyzer1.ErAnalyzer.Laner;
    Series := Laner.Series;
    CalcSerie := Series.Item(0As ILanerCalculateSerie;
    TransformModel := CalcSerie.Transform;
    FormulaTransform := TransformModel.Transform As IMsFormulaTransform;
    Formula := FormulaTransform.FormulaItem(0);
    StringGenerator := Formula.CreateStringGenerator;
    s := StringGenerator.Execute;
    Select Case StringGenerator.Formula.Level
        Case DimCalendarLevel.Year: s := s + " (year frequency)";
        Case DimCalendarLevel.Quarter: s := s + " (quarter frequency)";
        Case DimCalendarLevel.Month: s := s + " (months frequency)";
    End Select;
    CalcSerie.Name := s;
End Sub Button1OnClick;

After executing the example the string view of its calculation method with calendar frequency indication is used as a name of the first series. Frequency is specified, if it is annual, quarterly or monthly.

See also:

IMsFormulaStringGenerator