FilterLevelsOnLoad: Boolean;
FilterLevelsOnLoad: boolean;
The FilterLevelsOnLoad property determines whether to load data only by calendar levels, which are used in the problem calculation chain.
Available values:
True. The default value. Only data by the calendar levels, which are used in the problem calculation chain, is loaded. It enables the user to reduce time of problem calculation.
False. Data on all calendar levels are loaded.
Executing the example requires that the repository contains a modeling container with the MS identifier containing a modeling problem with the PROBLEM identifier.
Add links to the Metabase, Ms system assemblies.
Sub UserProc;
Var
Mb: IMetabase;
MsDescr: IMetabaseObjectDescriptor;
Problem: IMsProblem;
CalcSett: IMsProblemCalculationSettings;
Period: IMsModelPeriod;
ProblemCalc: IMsProblemCalculation;
Begin
Mb := MetabaseClass.Active;
// Get modeling container
MsDescr := Mb.ItemById("MS");
// Getnbsp;modelingnbsp;problem
Problem := Mb.ItemByIdNamespace("PROBLEM", MsDescr.Key).Bind As IMsProblem;
// Create problem calculation parameters
CalcSett := Problem.CreateCalculationSettings;
// Perform calculation by the Fact scenario
CalcSett.FactIncluded := True;
// Load data only by the calendar levels,
// which are used in the problem calculation chain
CalcSett.FilterLevelsOnLoad := True;
// Specify calculation period
Period := CalcSett.Period;
Period.IdentificationStartDate := DateTime.Parse("01.01.1990");
Period.IdentificationEndDate := DateTime.Parse("31.12.2009");
Period.ForecastStartDate := DateTime.Parse("01.01.2010");
Period.ForecastEndDate := DateTime.Parse("01.01.2015");
// Perform calculation
ProblemCalc := Problem.Calculate(CalcSett);
ProblemCalc.SaveHistory := True;
ProblemCalc.Run;
End Sub UserProc;
Example execution result: the problem will be calculated by the Fact scenario with sample and forecasting periods specified before calculation. Data for the calculation is loaded only by the levels of calendar, which are used in the problem calculation chain. Calculation history is saved.
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;
Problem: IMsProblem;
CalcSett: IMsProblemCalculationSettings;
Period: IMsModelPeriod;
ProblemCalc: IMsProblemCalculation;
Begin
Mb := Params.Metabase;
// Get modeling container
MsDescr := Mb.ItemById["MS"];
// Getnbsp;modelingnbsp;problem
Problem := Mb.ItemByIdNamespace["PROBLEM", MsDescr.Key].Bind() As IMsProblem;
// Create problem calculation parameters
CalcSett := Problem.CreateCalculationSettings();
// Perform calculation by the Fact scenario
CalcSett.FactIncluded := True;
// Load data only by the calendar levels,
// which are used in the problem calculation chain
CalcSett.FilterLevelsOnLoad := True;
// Specify calculation period
Period := CalcSett.Period;
Period.IdentificationStartDate := DateTime.Parse("01.01.1990");
Period.IdentificationEndDate := DateTime.Parse("31.12.2009");
Period.ForecastStartDate := DateTime.Parse("01.01.2010");
Period.ForecastEndDate := DateTime.Parse("01.01.2015");
// Perform calculation
ProblemCalc := Problem.Calculate(CalcSett);
ProblemCalc.SaveHistory := True;
ProblemCalc.Run();
End Sub;
See also: