Documentation

    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

    1. Row 1name = 'Ada'
    2. Row 2name = NULL
    3. Row 3name = ''

    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: ''

    Browse conditions & missing valuesDuckDB documentation

    Function metadata from DuckDB, used under the MIT license.