caseWhen
This section contains reference documentation for the caseWhen function.
Was this helpful?
This section contains reference documentation for the caseWhen function.
Was this helpful?
Returns values depending on boolean expressions. This function can only be used in an .
caseWhen(booleanExpr1, valueIfExpr1True, booleanExpr2, valueIfExpr2True) caseWhen(booleanExpr1, valueIfExpr1True, booleanExpr2, valueIfExpr2True, ... ,valueIfFalse)
booleanExpr1
A boolean expression
valueIfExpr1True
, valueIfExpr2True
A value to return.
The usage examples are based on extracting fields from the following JSON documents:
CASEWHEN(latitude > 0, 'North', 'South')
North
CASEWHEN(latitude > 0, 1, 0)
1
This function can be used in the to add northernHemisphere
column: