CalculationOption(Option: MsCalculationOptions): Boolean;
Option. One or several options which can be used for model calculation.
The CalculationOption property determines whether specified options are applied in model calculation.
Available values:
True. The specified options are applied in model calculation.
False. The specified options are not applied in model calculation.
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:
Intersections of identification and forecasting periods are calculated separately.
If model and parent object periods are not intersected, model will not be calculated. Corresponding warning will be displayed.
If sample periods of model and parent object are intersected and forecasting periods are not intersected, forecasting period will be aligned for the end of sample period received after sample periods of model and parent object intersection.
If forecasting periods of model and parent object are intersected, sample period will be aligned for the start of forecasting period obtained after model and parent object forecasting periods intersection.
The IMsModelPeriod.AllowForecastBeforeIdent property value is 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 |
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: