Sunday, July 7, 2019

Rules when Working with Numbers in Saved Search Formula

Important: This section provides some guidance when working with Search Formula.. It is assumed that you are familiar with the implementation of SQL expressions.


Oracle rules for working with numbers:

u  any number divided by zero returns an error

u  any number divided by null returns null

u  null is undefined/unknown

NetSuite and number fields:

u  Reports handle null values for you

u  Saved searches do not handle null values for you

u  Blank numbers in user interface are null

Divide by zero situation:

u  E.g. field A = 5, field B=0

u  A / B returns divide by zero error

u  A / NULLIF(B,0) returns null

      NULLIF(x,y) à if (x equals y, return null)

Display zero when a number is null:

u  E.g. field A = null

u  NVL(A, 0) returns zero

      NVL(x,y) à if (x equals null, return y)

No comments:

Post a Comment