Skip to content

Logical Operators

These rules use boolean operands (numerical values with 0 for false and not 0 for true) and return boolean values encoded as 0 or 1 numerical values.

And

Numerical And(Numerical boolean1, ...)

And logical operator.

Or

Numerical Or(Numerical boolean1, ...)

Or logical operator.

Not

Numerical Not(Numerical boolean)

Not logical operator.

If

Numerical If(Numerical test, Numerical valueTrue, Numerical valueFalse)

Ternary operator returning second operand (true) or third operand (false) according to the condition in first operand.

IfC

Categorical IfC(Numerical test, Categorical valueTrue, Categorical valueFalse)

Ternary operator returning second operand (true) or third operand (false) according to the condition in first operand.

IfD

Date IfD(Numerical test, Date valueTrue, Date valueFalse)

Ternary operator returning second operand (true) or third operand (false) according to the condition in first operand.

IfT

Time IfT(Numerical test, Time valueTrue, Time valueFalse)

Ternary operator returning second operand (true) or third operand (false) according to the condition in first operand.

IfTS

Timestamp IfTS(Numerical test, Timestamp valueTrue, Timestamp valueFalse)

Ternary operator returning second operand (true) or third operand (false) according to the condition in first operand.

IfTSTZ

TimestampTZ IfTSTZ(Numerical test, TimestampTZ valueTrue, TimestampTZ valueFalse)

Ternary operator returning second operand (true) or third operand (false) according to the condition in first operand.

Switch

Numerical Switch(Numerical test, Numerical valueDefault, Numerical value1, ..., Numerical valueK)

Switch operator that returns the numerical value corresponding to the index given by the test operand if it is between 1 and K. The default value is returned if the index if outside the bounds.

SwitchC

Categorical SwitchC(Numerical test, Categorical valueDefault, Categorical value1, ..., Categorical valueK)

Switch operator that returns the categorical value corresponding to the index given by the test operand if it is between 1 and K. The default value is returned if the index if outside the bounds.