Conditional expressions
When specifying the expression, you must enclose the expression in parenthesis: (expression)
The expression consists of operands and operators, where operands can also be an expression:
- Expression = (Operand_A operator Operand_B)
- Operand_A, Operand_B = constant (integer/float/string), property, expression
- Operator = comparison operator or range operator
- Range operands a and b refer to constant (integer/float/string) of the table field
This table shows the comparison operators you can use in the expression:
| = | Equal to |
| <> | Not equal to |
| != | Not equal to |
| > | Greater than |
| < | Less than |
| >= | Greater than or equal to |
| <= | Less than or equal to |
This table shows the range definition:
| [a..b] | Range between a and b, including both a and b |
| [a..b> | Range between a and b, including a and excluding b |
| <a..b] | Range between a and b, excluding a and including b |
| <a..b> | Range between a and b, excluding both a and b |
| in | Exists in a set or a range |
| not in | Does not exist in a set or a range |
This table shows some examples:
| (A != 9.0) | True if A does not equal 9.0 |
| (A <= “Davies”) | True if A is less than or equal to “Davies” |
| (A in [3.4..8.10]) | True if A is in the range 3.4 to 8.10 |
| (A in [3..8>) | True if A is in the range 3 to 8, excluding value 8 itself.` |
You can use commas to specify a set of values.
This table shows some examples:
| (A in [a,b]) | True if A is equal to a or b |
| (A in [a,b,e,f,z]) | True if A is equal to a, b, e, f, or z |
You can logically combine conditional expressions into compound boolean (and, or) or arithmetic (+, -, *, /) expressions.
This table shows some examples:
| ((A in [3.4..8]) and (B > 2)) | True if A is in the range 3.4 to 8 and B is greater than 2 |
| (B in <”Brown”..”Miller”]) | True if B is in the range 'Brown' to 'Miller', excluding the value 'Brown' itself |
| (((A <> 6) and (B >= 9)) or (C <= 7)) | True in these two situations:
|
To define null values in a condition, for example for a datetime datatype, the NULL value is: 1970-01-01T00:00:00Z.
This table shows some examples that are syntactically incorrect:
| A = 12 | Expression must be enclosed in ( ) |
| (A = 1,2,3 ) | Expression is true if A has value 1,2,3
Expression does not mean that A is either 1, or 2, or 3 |
| (A in [(V1),(V2)]) | Use of parenthesis to enclose the value |
| (A = 1 , B = 2 ) | Multiple expressions must be combined with and/or operation |
| (A = 1 B = 2 ) | Multiple expressions must be combined with and/or operation |
| (A = 1 / B = 2 ) | Multiple expressions must be combined with and/or operation |
| (A in <1 , 2> ) | Set must be represented in [ ] |
| (A in <1 , 2] ) | Set must be represented in [ ] |
| (A in [1 , 2> ) | Set must be represented in [ ] |
| (A in [2,]) | Missing value in set |
| (A in [1, 2, 15..20 ] ) | Combined set and range should be constructed using separate expressions |
| (A in [1..5, 11..20 ]) | Combined set and range should be constructed using separate expressions |
| (!A) | Invalid use of operation ‘!’. A valid combination is ‘!=’ |
| (A !< B) | Invalid use of operation ‘!’. A valid combination is ‘!=’ |
| (A not = B) | Invalid use of ‘not’. Use 'not' only with set/range comparison |
| (not A) | Invalid use of ‘not’. Use 'not' only with set/range comparison |