IMsCustomTerm.IsPeriod

Fore Syntax

IsPeriod(StartDate: String; [EndDate: String = "SameDate";][CustomFrequency: MsFrequancy = 0])

Fore.NET Syntax

IsPeriod(StartDate: string; EndDate: string;
    CustomFrequency: Prognoz.Platform.Interop.Ms.MsFrequancy;
    Context: Prognoz.Platform.Interop.Fore.IForeRuntimeContext): object;

Parameters

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.

Description

The IsPeriod method returns the dummy variable that determines whether the observation is in the specified period.

Comments

The following dummies may be implemented within this method:

Fore Example

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.

Fore.NET Example

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:

IMsCustomTerm