Logical Functions
between
Syntax | between(ARG,START,END) |
---|---|
Parameters | 1. Parameter for calculation, any type; 2. Specified start, any type; 3. Specified end, any type |
Return Type | Boolean |
Description | Determines whether arg is between [start, end] |
Example | between(5, 1, 10), returns: TRUE |
between_ie
Syntax | between_ie(ARG,START,END) |
---|---|
Parameter Description | 1. Parameter for calculation, any type; 2. Specified start, any type; 3. Specified end, any type |
Return Type | Boolean |
Description | Determines whether arg is within the range (start, end], a left-open and right-closed interval |
Example | between_ie(5, 5, 10), returns: FALSE (because the left boundary is not included) |
case when
Syntax | case when condition then result1 [else result2] end |
---|---|
Parameter Description | condition is an expression that returns a Boolean value |
Return Type | Consistent with the types of result1 and result2 |
Description | This function outputs based on the return result of the condition expression. When condition is true, it returns result1. When condition is false, it returns result2. The else branch is not mandatory. |
Example | case when {code} = 2 then 'Excellent' when {code} = 1 then 'Pass' else 'Fail' end |
coalesce
Syntax | coalesce(ARG, REPLACEMENT) |
---|---|
Parameters | 1. The parameter involved in the calculation, any type; 2. The value used to replace NULL, any type (must be of the same type as the first parameter) |
Return Type | ANY |
Description | Replaces NULL values in arg with another value |
Examples | coalesce(null, 'default value'), returns: 'default value'; coalesce(123, 0), returns: 123 |
Unsupported Data Sources | None |
if
Syntax | if(B,TRUE,FALSE) |
---|---|
Parameter Description | 1. Condition, Boolean type parameter, optional type: Boolean; 2. Value when the condition is true, any type; 3. Value when the condition is false, any type |
Return Type | ANY |
Description | Conditional branching judgment, the types of the last two parameters must be the same. |
Example | if({score}>=60, 'Pass', 'Fail'), returns: a corresponding string based on the value of the score field |
in
Syntax | in(ARG, ARR) |
---|---|
Parameters | 1. Parameter involved in calculation, any type; 2. Array type parameter, optional type: ARRAY |
Return Type | Boolean |
Description | Whether the value of the field is in the list |
Example | in('apple', ['banana', 'apple']), returns: TRUE |
isnull
Syntax | isnull(ARG) |
---|---|
Parameter | The parameter involved in the calculation, any type |
Return Type | Boolean |
Description | Determines whether the specified field is null |
Example | isnull(null), returns: TRUE |
isnotnull
Syntax | isnotnull(ARG) |
---|---|
Parameter | The parameter involved in the calculation, any type |
Return Type | Boolean |
Description | Determines whether the specified field is not null |
Example | isnotnull('test'), returns: TRUE |
not_between
Syntax | not_between(ARG,START,END) |
---|---|
Parameter Description | 1. Parameter for calculation, any type; 2. Specified start, any type; 3. Specified end, any type |
Return Type | Boolean |
Description | Determines whether arg is outside [start, end] |
Example | not_between(5, 1, 10), returns: FALSE |
notin
Syntax | notin(ARG,ARR) |
---|---|
Parameter Description | 1. Parameter involved in calculation, any type; 2. Array type parameter, optional type: ARRAY |
Return Type | Boolean |
Description | Checks whether the value of the field is outside the list |
Example | notin('apple', ['banana', 'apple']), returns: FALSE |