Skip to main content

CASE_WHEN function

Returns one value if a logical expression (condition) is TRUE and another if it is FALSE.

Syntax

case_when(<condition>, <then>, <else>)
ParameterTypeDescription
conditionbool
thenany
elseany

Usages

case_when(`total_amount` > 100, "High", "Low")