Data 360 SQL and Tableau Hyper API
Type Conversions
Logical Operators
CASE
COALESCE
GREATEST and LEAST
NULLIF
DID THIS ARTICLE SOLVE YOUR ISSUE?
Let us know so we can improve!
Let us know so we can improve!
COALESCEApplies to: ✅ Data 360 SQL ✅ Tableau Hyper API
Returns the first of its arguments that isn’t NULL.
1COALESCE(<value>, ...)<value>: An expression to evaluate. Provide two or more arguments. All arguments must be convertible to a common data type.Returns the first argument that isn’t NULL. Returns NULL only if all arguments are NULL.
COALESCE evaluates only the arguments needed to determine the result. COALESCE doesn’t evaluate arguments after the first non-NULL argument.COALESCE to substitute a default value for NULL values when displaying retrieved data.Return the first non-NULL value and fall back to a placeholder when the earlier values are NULL.
1SELECT COALESCE(NULL, 'backup', '(none)') AS result;Returns backup. This query returns the first argument if it isn’t NULL. Otherwise, it returns the second argument if it isn’t NULL. Otherwise, it returns (none).