nullIf - Amazon QuickSight
Services or capabilities described in Amazon Web Services documentation might vary by Region. To see the differences applicable to the China Regions, see Getting Started with Amazon Web Services in China (PDF).

nullIf

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

Syntax

nullIf(expression1, expression2)

Arguments

nullIf takes two expressions as arguments.

expression

The expression can be numeric, datetime, or string. It can be a field name, a literal value, or another function.

Return type

String

Example

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

nullIf(delayReason, 'unknown')

The following are the given field values.

delayReason ============ unknown back ordered weather delay

For these field values, the following values are returned.

(null) back ordered weather delay