Skip to main content Skip to complementary content

EmptyIsNull Script and chart function

The EmptyIsNull function converts empty strings to NULL. Hence, it returns NULL if the parameter is an empty string, otherwise it returns the parameter.

Syntax:  

EmptyIsNull(exp )

Return data type: NULL if the parameter is an empty string, otherwise it returns the parameter

Arguments
Argument Description
expr The expression or field containing the data to be measured.
Example: Chart expressions
Example Result

EmptyIsNull(AdditionalComments)

This expression will return NULL for any empty string values of the AdditionalComments field instead of empty strings. Non-empty strings and numbers are returned.

EmptyIsNull(PurgeChar(PhoneNumber, ' -()'))

This expression will strip any dashes, spaces, and parentheses from the PhoneNumber field. If there are no characters left, the EmptyIsNull function returns the empty string as NULL; an empty phone number is the same as no phone number.

Example - EmptyIsNull fundamentals

Example - Replacing null values with text and adding conditional formatting

Did this page help you?

If you find any issues with this page or its content – a typo, a missing step, or a technical error – please let us know!