Formula: IMsFormula;
The Formula property returns parameters of the method used to calculate the model.
Executing the example requires a form, a button on this form with the Button1 identifier, the LanerBox component and the UiErAnalyzer component named UiErAnalyzer1, which 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.
Add links to the Ms, Cubes, Dimensions system assemblies. The example is handler of the OnClick event for button.
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(0) As 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: