Logical disjunction: or
Syntax
op1 or op2
Input parameters
op1 |
the first operand |
op2 |
the second operand |
Examples of valid syntaxes
DS_1 or DS_2
Semantics for scalar operations
The or operator returns TRUE if at least one of the operands is TRUE, otherwise FALSE.
The two operands must be of boolean type.
For example:
| FALSE or FALSE
gives FALSE
| FALSE or TRUE
gives TRUE
| FALSE or NULL
gives NULL
| TRUE or FALSE
gives TRUE
| TRUE or TRUE
gives TRUE
| TRUE or NULL
gives TRUE
| NULL or NULL
gives NULL
Input parameters type
op1, op2
dataset {measure<boolean> _ }
| component<boolean>
| boolean
Result type
result
dataset {measure<boolean> _ }
| component<boolean>
| boolean
Additional Constraints
None.
Behavior
The operator has the typical behaviour of the “Behaviour of Boolean operators” (see the section “Typical behaviours of the ML Operators”).
Examples
Given the operand datasets DS_1 and DS_2:
Input DS_1 (see structure)
Id_1 |
Id_2 |
Id_3 |
Id_4 |
Me_1 |
---|---|---|---|---|
M |
15 |
B |
2013 |
True |
M |
64 |
B |
2013 |
False |
M |
65 |
B |
2013 |
True |
F |
15 |
U |
2013 |
False |
F |
64 |
U |
2013 |
False |
F |
65 |
U |
2013 |
True |
Input DS_2 (see structure)
Id_1 |
Id_2 |
Id_3 |
Id_4 |
Me_1 |
---|---|---|---|---|
M |
15 |
B |
2013 |
False |
M |
64 |
B |
2013 |
True |
M |
65 |
B |
2013 |
True |
F |
15 |
U |
2013 |
True |
F |
64 |
U |
2013 |
False |
F |
65 |
U |
2013 |
False |
Example 1
DS_r:= DS_1 or DS_2;
results in (see structure):
Id_1 |
Id_2 |
Id_3 |
Id_4 |
Me_1 |
---|---|---|---|---|
M |
15 |
B |
2013 |
True |
M |
64 |
B |
2013 |
True |
M |
65 |
B |
2013 |
True |
F |
15 |
U |
2013 |
True |
F |
64 |
U |
2013 |
False |
F |
65 |
U |
2013 |
True |
Example 2
DS_r:= DS_1 [ calc Me_2:= Me_1 or true ];
results in (see structure):
Id_1 |
Id_2 |
Id_3 |
Id_4 |
Me_1 |
Me_2 |
---|---|---|---|---|---|
M |
15 |
B |
2013 |
True |
True |
M |
64 |
B |
2013 |
False |
True |
M |
65 |
B |
2013 |
True |
True |
F |
15 |
U |
2013 |
False |
True |
F |
64 |
U |
2013 |
False |
True |
F |
65 |
U |
2013 |
True |
True |