IsPeriod(StartDate: String;
[EndDate: String = "SameDate";]
[CustomFrequency: MsFrequancy = 0]): Variant;
StartDate. Period start date.
EndDate. Period end date.
CustomFrequency. The frequency, for which values are created.
The IsPeriod method returns the dummy variable that determines whether the observation hits the specified period.
The following dummies may be implemented within this method:
Single jump. Only one of the series values must be highlighted. For example, in the series with monthly frequency the values for the July of 2008 must be selected, then the variable is: IsPeriod (2008M07).
Jump to a certain period. The series values hitting the specified range must be highlighted. For example, in the series with monthly frequency the values from the July of 2008 to the July of 2009 must be selected, then the variable is: IsPeriod ("2008M07","2009M07").
Jump starting with the specified date and to the end. For example, in the series with monthly frequency the values starting with July of 2008 must be selected, then the variable is: IsPeriod ("2008M07",NoDate).
Jump to a certain date. For example, in the series with monthly frequency the values from the start of observations to the July of 2008 must be selected, then the variable is: IsPeriod (NoDate,"2008M07").
Features of setting parameters:
EndDate. Optional parameter for Fore. The default value corresponds to the period start date. This value is returned by the IMsCustomTerm.SameDate method.
Context. Optional parameter for Fore. By default, the frequency is undefined and matches the model frequency.
Executing the example requires that the repository contains a modeling container with the CONT_MODEL identifier that contains a determinate equation model with the DUMMIS_DETERM identifier.
Add links to the Metabase and Ms system assemblies.
Sub UserProc;
Var
mb: IMetabase;
MsDescr: IMetabaseObjectDescriptor;
Model: IMsModel;
Transf: IMsFormulaTransform;
Determ: IMsDeterministicTransform;
Begin
mb := MetabaseClass.Active;
MsDescr := mb.ItemById("CONT_MODEL");
Model := mb.ItemByIdNamespace("DUMMIES_DETERM", MsDescr.Key).Edit As IMsModel;
Transf := Model.Transform;
Determ := Transf.FormulaItem(0).Method As IMsDeterministicTransform;
Determ.Expression.AsString := "IsPeriod(""" + "2000A" + """,NoDate)";
(Model As IMetabaseObject).Save;
End Sub UserProc;
After executing the example the IsPeriod and NoDate dummy variables are used in the model equation. The dummy selects values starting with 2000 year and till the end of the sample period.
See also: