SpecifiedTerm: IMsFormulaTermInfo;
The SpecifiedTerm property determines the series that is used in missing data treatment.
The series is set as a term. The missing data treatment method is defined by the property IMissingData.Method.
SpecifiedTerm is taken into account for the following methods of missing data treatment:
MissingDataMethod.Pattern. To calculate the empty values of series, the interpolation by pattern specified by other series is used.
MissingDataMethod.Overlay. Missing data is substituted with values of the specified series.
Executing the example requires that the repository contains a modeling container with the OBJ_MS identifier, that contains a model with the MODEL identifier and a variable with the OBJ_VAR identifier. The model is calculated by the Grey forecast. It is also necessary to add links to the Ms, Metabase and Stat system assemblies.
Sub UserProc;
Var
Mb: IMetabase;
MsDescrKey: Integer;
Model: IMsModel;
ModelTrans: IMsFormulaTransform;
Formula: IMsFormula;
Grey: IMsGreyForecastTransform;
MissingData: IMsMissingData;
Series: IMsFormulaTransformVariables;
OverlayVar: IMsVariableStub;
Ser: IMsFormulaTransformVariable;
TermInfo: IMsFormulaTermInfo;
Begin
Mb := MetabaseClass.Active;
MsDescrKey := Mb.ItemById("OBJ_MS").Key;
// Get model
Model := MB.ItemByIdNamespace("MODEL", MsDescrKey).Edit As IMsModel;
ModelTrans := Model.Transform;
// Set up model calculation parameters
Formula := ModelTrans.FormulaItem(0);
Grey := Formula.Method As IMsGreyForecastTransform;
MissingData := Grey.MissingData As IMsMissingData;
Series := ModelTrans.Series;
OverlayVar := MB.ItemByIdNamespace("OBJ_VAR", MsDescrKey).Edit As IMsVariableStub;
Ser := Series.Add(OverlayVar As IVariableStub);
TermInfo := ModelTrans.CreateTermInfo;
TermInfo.Slice := Ser.Slices.Add(Null);
MissingData.Method := MissingDataMethod.Pattern;
MissingData.SpecifiedTerm := TermInfo;
// Save the parameters of calculation of model
(Model As IMetabaseObject).Save;
End Sub UserProc;
After executing the example, a new missing data treatment method (by pattern) is set for the model. To calculate the empty values, use the interpolation by pattern set by the OBJ_VAR variable.
See also: