IMsFormulaTransform.CalculationOption

Syntax

CalculationOption(Option: MsCalculationOptions): Boolean;

Parameters

Option. One or several options which can be used for model calculation.

Description

The CalculationOption property determines whether specified options are applied in model calculation.

Comments

Available values:

If on reception the option returns True, it is applied, if False - it is not applied. If value of several options is received, True is returned, if all asked options are applied, otherwise False is returned.

If the MsCalculationOptions.IntersectPeriods and MsCalculationOptions.UseTransformPeriod options are applied, that is, model and its parent object periods are intersected, then the following features should be taken into account:

Example of the model and its parent object periods intersectoin:

The IMsModelPeriod.AllowForecastBeforeIdent value Week periods Parent object periods Periods after intersection
Identification Forecasting Identification Forecasting Identification Forecasting
False 1980-2000 2001-2010 1990-2005 2006-2020 1990-2000 2006-2010
False 1980-2000 2001-2010 1970-1990 1991-1999 1980-1990 1990-1990
False 1980-2000 2001-2010 2001-2005 2006-2008 2006-2006 2006-2008
False 1980-2000 2001-2010 2011-2014 2014-2017 Model is not calculated
True 1980-2000 1990-2010 1990-2001 1998-2005 1990-2000 1998-2005

Example

Executing the example requires that the repository contains a modeling container with the MS identifier containing a modeling problem with the PROBLEM_CALC_OPTIONS identifier. The calculation chain of this problem should include a model with the MODEL_CALC_OPTIONS identifier.

Add links to the Metabase, Ms system assemblies.

Sub UserProc;
Var
    mb: IMetabase;
    MsKey: Integer;
    Problem: IMsProblem;
    CalcChain: IMsCalculationChainEntries;
    ChainModel: IMsCalculationChainModel;
    Model: IMsModel;
    Transform: IMsFormulaTransform;
Begin
    // Get current repository
    mb := MetabaseClass.Active;
    // Get modelling container key
    MsKey := mb.GetObjectKeyById("MS");
    // Get modeling problem
    Problem := mb.ItemByIdNamespace("PROBLEM_CALC_OPTIONS", MsKey).Bind As IMsProblem;
    // Get calculation chain used by the problem
    CalcChain := Problem.MetaModel.CalculationChain;
    // Get the model
    ChainModel := CalcChain.FindById("MODEL_CALC_OPTIONS"As IMsCalculationChainModel;
    Model := ChainModel.EditModel;
    // Get model calculation parameters
    Transform := Model.Transform;
    // Determine that model and its parent object periods are intersected
    Transform.CalculationOption(MsCalculationOptions.IntersectPeriods
        Or MsCalculationOptions.UseExistingData) := True;
    // Save changes  
    (Model As IMetabaseObject).Save;
End Sub UserProc;

After executing the example, intersection of model calculation periods and the PROBLEM_CALC_OPTIONS modeling problem calculation periods will be applied for the MODEL_CALC_OPTIONS model.

See also:

IMsFormulaTransform