coalesce
Replace missing values with the first available alternative.
Try an expression
In Formula, enter the expression and set Output type to VARCHAR.
Example input
- Row 1
name = 'Ada' - Row 2
name = NULL - Row 3
name = ''
Expression
coalesce(name, 'Unknown')Result
Row 1: 'Ada'
Row 2: 'Unknown'
Row 3: ''NULL means the value is missing.
Arguments and types
coalesce(expr, ...)The result type can depend on the input types. See DuckDB for the full argument rules.
Things to know
An empty string is a value
coalesce('', 'Unknown')Every row: ''
Function metadata from DuckDB, used under the MIT license.