Menu
Amazon QuickSight
User Guide

nullIf Function

nullIf compares two expressions. If they are equal, the function returns null. If they are not equal, the function returns the first expression.

Syntax

Copy
nullIf(expression, expression)

Arguments

nullIf takes two expressions as arguments.

expression

The expression must be a string. It can be a field name like address1, a literal value like 'Unknown', or a call to another function that outputs a string.

Return Type

String

Example

The following example returns nulls if the reason for a ship ment delay is unknown.

Copy
nullIf({delay reason}, 'unknown')

For the field values:

Copy
delay reason ============ unknown back ordered weather delay

The following values are returned:

Copy
(null) back ordered weather delay