CASE
Choose a result using one or more conditions.
Try an expression
In Formula, enter the expression and set Output type to VARCHAR.
Example input
- Row 1
amount = 20 - Row 2
amount = 120 - Row 3
amount = NULL
Expression
CASE WHEN amount > 100 THEN 'high' ELSE 'low' ENDResult
Row 1: 'low'
Row 2: 'high'
Row 3: 'low'NULL means the value is missing.
Arguments and types
CASE WHEN condition THEN result ELSE fallback ENDThe result type can depend on the input types. See DuckDB for the full argument rules.
Function metadata from DuckDB, used under the MIT license.