DefaultLevel: DimCalendarLevel;
The DefaultLevel property determines the level of calendar frequency used by default on problem calculation.
The default value is DimCalendarLevel.None.
If the chain element inherits the period and calculation frequency of a parent element, that is, IMsCalculationChainEntry.InheritModelPeriod is set to True, but during calculation this information was not received from the parent, the chain element uses the period IMsproblemCalculationSettings.Period and calendar level IMsproblemCalculationSettings.DefaultLevel.
Executing the example requires that the repository contains a modeling container with the MS identifier containing a transformation problem with the PROBLEM identifier.
Add links to the Dimensions, Metabase, Ms system assemblies.
Sub UserProc;
Var
Mb: IMetabase;
ModelSpaceD: IMetabaseObjectDescriptor;
Problem: IMsProblem;
CalcSett: IMsProblemCalculationSettings;
Begin
Mb := MetabaseClass.Active;
// Get modeling container
ModelSpaceD := Mb.ItemById("MS");
// Get modeling problem
Problem := Mb.ItemByIdNamespace("PROBLEM", ModelSpaceD.Key).Bind As IMsProblem;
// Create problem calculation settings
CalcSett := Problem.CreateCalculationSettings;
// Set problem calculation periods
CalcSett.Period.IdentificationStartDate := DateTime.Parse("01.01.2000");
CalcSett.Period.IdentificationEndDate := DateTime.Parse("31.12.2004");
CalcSett.Period.ForecastStartDate := DateTime.Parse("01.01.2005");
CalcSett.Period.ForecastEndDate := DateTime.Parse("31.12.2007");
// Set problem calculation frequency
CalcSett.DefaultLevel := DimCalendarLevel.Year;
// Set date extension parameters
CalcSett.CorrectStubPeriod := MsCorrectStubPeriod.CorrectProblemPeriod;
// Perform calculation
Problem.Calculate(CalcSett).Run;
End Sub UserProc;
After executing the example the following is set for modeling problem: date extension parameters, calculation period and calendar frequency used by default. Problem is calculated.
See also: