InputFactorTerm: IMsFormulaTermInfo;
The InputFactorTerm property determines parameters of the input term.
The property is outdated, use IMsMethodSeries.Input.
Executing the example requires a form, a button with the Button1 identifier on this form, the TabSheetBox component and the UiErAnalyzer component named UiErAnalyzer1 that is used as a data source for TabSheetBox. Working area of the time series database must be loaded to UiErAnalyzer1. This time series database must include a time series with the key 98280 that contains annual data.
Click the button to start executing of this example.
Sub Button1OnClick(Sender: Object; Args: IMouseEventArgs);
Var
Laner: ILaner;
Series: ILanerSeries;
RubrIn: IRubricatorInstance;
Factor: IRubricatorFactor;
Serie: ILanerSourceSerie;
VarStub: IVariableStub;
CalcSerie: ILanerCalculateSerie;
TransformModel: IFormulaTransformModel;
FormulaTransform: IMsFormulaTransform;
Slice: IMsFormulaTransformSlice;
Selector: IMsFormulaTransformSelector;
Formula: IMsFormula;
GreyForecast: IMsGreyForecastTransform;
TermInfo: IMsFormulaTermInfo;
Begin
Laner := UiErAnalyzer1.ErAnalyzer.Laner;
RubrIn := Laner.RubricatorInstance;
Factor := RubrIn.GetFactData(98280).Factor;
Laner.BeginUpdate;
Series := Laner.Series;
Serie := Series.AddSourceSerie(Factor);
VarStub := Serie.Stub;
CalcSerie := Series.AddCalculateSerie("GreyForecast");
TransformModel := CalcSerie.Transform;
TransformModel.AddInputVariable(VarStub);
FormulaTransform := TransformModel.Transform As IMsFormulaTransform;
FormulaTransform.Inputs.Add(VarStub);
Slice := FormulaTransform.Outputs.Item(0).Slices.Add(Null);
Selector := FormulaTransform.CreateSelector;
Selector.Slice := Slice;
Formula := FormulaTransform.Transform(Selector);
Formula.Kind := MsFormulaKind.GreyForecast;
Formula.Level := DimCalendarLevel.Year;
GreyForecast := Formula.Method As IMsGreyForecastTransform;
Slice := FormulaTransform.Inputs.Item(0).Slices.Add(Null);
TermInfo := FormulaTransform.CreateTermInfo;
TermInfo.Slice := Slice;
GreyForecast.InputFactorTerm := TermInfo;
Laner.EndUpdate;
WinApplication.InformationBox(CalcSerie.SaveModel.Name);
End Sub Button1OnClick;
After executing the example the new series, based on the time series with the 98280 key, is added. Based on it, the series, calculated by the Grey Forecast method is created. The calculated series is saved as a model, name of which is displayed in the information message.
See also: