IMsModel.TreatNullsAsZeros

Fore Syntax

TreatNullsAsZeros: Boolean;

Fore.NET Syntax

TreatNullsAsZeros: boolean;

Description

The TreatNullsAsZeros property determines whether to replace empty values with zeroes on model calculation.

Comments

Empty value is Null.

TreatNullsAsZeros:

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.

Fore Example

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.

Fore.NET Example

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;
    mObj: IMetabaseObject;
    Model: IMsModel;
Begin
    mb := Params.Metabase;
    mObj := mb.ItemByIdNamespace["MODEL", mb.GetObjectKeyById("MS_59436")].Edit();
    Model := mObj As IMsModel;
    Model.TreatNullsAsZeros := True;
    mObj.Save();
End Sub;

See also:

IMsModel