TreatNullsAsZeros: Boolean;
The TreatNullsAsZeros property determines whether to replace empty values with zeroes on model calculation.
Empty value is Null.
TreatNullsAsZeros:
True. Empty values in the data of variables are replaced with zeroes on model calculation. Note that the missing data treatment will not work.
False. The default value. On calculating the model only missing data treatment methods are applied to empty values in the variable data.
NOTE. The IMsModel.TreatNullsAsZeros and IMsProblemCalculation.TreatNullsAsZeros properties work together by the OR condition. For example, if the TreatNullsAsZeros model is set to False, and the TreatNullsAsZeros problem calculating this model is set to True, empty values are replaced with zeroes.
This capability enables the user to manage replacing empty values with zeroes both for each model individually and for all models calculated by the problem.
Executing the example requires that the repository contains a modeling container with the MS identifier containing a model with the MODEL identifier.
Add links to the Metabase, Ms system assemblies.
Sub UserProc;
Var
mb: IMetabase;
mObj: IMetabaseObject;
Model: IMsModel;
Begin
mb := MetabaseClass.Active;
mObj := mb.ItemByIdNamespace("MODEL", mb.GetObjectKeyById("MS")).Edit;
Model := mObj As IMsModel;
Model.TreatNullsAsZeros := True;
mObj.Save;
End Sub UserProc;
After executing the example empty values are replaced with zeroes on model calculation.
See also: