IMsModelPeriod.ForecastEndDateParamID

Syntax

ForecastEndDateParamID: String;

Description

The ForecastEndDateParamID property determines identifier of the parameter that sets forecasting period end date.

Comments

If the parameter is not set or not found, the data is determined by the IMsModelPeriod.ForecastEndDate property.

The parameter value can be:

Features of using number and string values are given in description of the IMsModelPeriod.IdentificationEndDateParamID property.

Example

Executing the example requires that the repository contains a modeling container with the CONT_M identifier. This container should include a forecasting problem with the PROBLEM identifier that calculates a metamodel with the MODEL identifier. The metamodel must contain a model with the MODEL identifier in the calculation chain.

Add links to the Metabase, Ms, Dal system assemblies.

Sub UserProc;
Var
    mb: IMetabase;
    cm: IMetabaseObjectDescriptor;
    MetaModel: IMsMetaModel;
    pParams: IMsModelParams;
    pPar: IMsModelParam;
    pModel: IMsModel;
    pPeriod: IMsModelPeriod;
    pProb: IMsProblem;
    pSet: IMsProblemCalculationSettings;
    pCalc: IMsProblemCalculation;
Begin
    mb := MetabaseClass.Active;
    cm := mb.ItemById("CONT_M");
    MetaModel := mb.ItemByIdNamespace("M_MODEL", cm.Key).Edit As IMsMetaModel;
    pParams := MetaModel.Params;
    pParams.Clear;
// Add metamodel parameters for setting of sample period start/end
    pPar := pParams.Add;
    pPar.Id := "IDSTART";
    pPar.DataType := DbDataType.DateTime;
    pPar := pParams.Add;
    pPar.Id := "IDEND";
    pPar.DataType := DbDataType.DateTime;
    (MetaModel As IMetabaseObject).Save;
// Add metamodel parameters for setting of forecast period start/end
    pPar := pParams.Add;
    pPar.Id := "FOSTART";
    pPar.DataType := DbDataType.DateTime;
    pPar := pParams.Add;
    pPar.Id := "FOEND";
    pPar.DataType := DbDataType.DateTime;
    (MetaModel As IMetabaseObject).Save;
    pModel := mb.ItemByIdNamespace("MODEL", cm.Key).Edit As IMsModel;
// Set model parameters that determine the sample period start or end
    pPeriod := pModel.Period;
    pPeriod.IdentificationStartDateParamID := "IDSTART";
    pPeriod.IdentificationEndDateParamID := "IDEND";
// Set model parameters that determine forecast period start and end
    pPeriod := pModel.Period;
    pPeriod.ForecastStartDateParamID := "FOSTART";
    pPeriod.ForecastEndDateParamID := "FOEND";
    (pModel As IMetabaseObject).Save;
    pProb := mb.ItemByIdNamespace("PROBLEM", cm.Key).Bind As IMsProblem;
    pSet := pProb.CreateCalculationSettings;
    pSet.FactIncluded := True;
// Set value of parameters and calculate model
    pSet.ParamValues.FindById("IDSTART").Value := DateTime.ComposeDay(200011);
    pSet.ParamValues.FindById("IDEND").Value := DateTime.ComposeDay(200711);
    pSet.ParamValues.FindById("FOSTART").Value := DateTime.ComposeDay(200811);
    pSet.ParamValues.FindById("FOEND").Value := DateTime.ComposeDay(201511);
    pCalc := pProb.Calculate(pSet);
    pCalc.Run;
End Sub UserProc;

After executing the example sample period start and end are set by the IDSTART and IDEND parameters, and forecasting period start and end are set by the FOSTART and FOEND parameters.

See also:

IMsModelPeriod