IsPeriod(StartDate: String; [EndDate: String = "SameDate";][CustomFrequency: MsFrequancy = 0])
IsPeriod(StartDate: string; EndDate: string;
CustomFrequency: Prognoz.Platform.Interop.Ms.MsFrequancy;
Context: Prognoz.Platform.Interop.Fore.IForeRuntimeContext): object;
StartDate. Period start date.
EndDate. Period end date. Optional parameter. The default value corresponds to the period start date. This value is returned by the IMsCustomTerm.SameDate method.
CustomFrequency. The frequency, values for which are created. Optional parameter. By default, the frequency is undefined and matches the model frequency.
Context. Context. It is applied only in Fore.NET.
The IsPeriod method returns the dummy variable that determines whether the observation is in 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").
Executing the example requires a modeling container with the CONT_MODEL identifier that contains a determinate equation model with the DUMMIS_DETERM identifier. Add links to the Metabase, 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.
The requirements and result of the Fore.NET example execution match with those in the Fore example.
Imports Prognoz.Platform.Interop.Ms;
…
Public Shared Sub Main(Params: StartParams);
Var
mb: IMetabase;
MsDescr: IMetabaseObjectDescriptor;
Model: IMsModel;
Transf: IMsFormulaTransform;
Determ: IMsDeterministicTransform;
Begin
mb := Params.Metabase;
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;
See also: