ScenarioIncluded(ScenarioKey: Integer): Boolean;
ScenarioKey. Key of the scenario, according to which the data is loaded to modeling variable. If it is necessary to load by the Fact dimension, the value -1 is set.
The ScenarioIncluded property determines whether the data is loaded by the dimension. The dimension key is passed by the ScenarioKey parameter.
Executing the example requires that the modeling container includes the Var_1 variable that is set load to data by means of the formula.
Sub Main;
Var
MB: IMetabase;
MObj: IMetabaseObject;
Variable: IMsVariable;
LoadSetting: IMsVariableLoadSettings;
Period: IMsModelPeriod;
i: Integer;
Begin
MB := MetabaseClass.Active;
MObj := MB.ItemByIdNamespace("Var_1", MB.ItemById("KONT_MODEL").Key).Edit;
Variable := MObj As IMsVariable;
LoadSetting := Variable.CreateLoadSettings;
Period := LoadSetting.Period;
Period.IdentificationStartDate := DateTime.ComposeDay(2000, 1, 1);
Period.IdentificationEndDate := DateTime.ComposeDay(2004, 1, 1);
LoadSetting.ScenarioIncluded(-1) := True;
For i := 0 To LoadSetting.DimensionFix.Count - 1 Do
LoadSetting.DimensionFix.Selection.Item(i).SelectAll;
End For;
Variable.Execute(LoadSetting);
MObj.Save;
End Sub Main;
After executing the example the parameters necessary for data loading in a variable are determined, then data is loaded.
See also: