Logical disjunction · or
---
config:
flowchart:
useMaxWidth: false
---
flowchart TB
classDef ok fill:#d4edda,stroke:#28a745,color:#000
classDef partial fill:#fff3cd,stroke:#ffc107,color:#000
classDef refused fill:#d4edda,stroke:#28a745,stroke-width:3px,stroke-dasharray: 2 2,color:#000
classDef missing fill:#f8d7da,stroke:#dc3545,color:#000
classDef diverge fill:#cce5ff,stroke:#007bff,color:#000
classDef block fill:#2b3a4a,stroke:#2b3a4a,color:#fff,font-weight:bold
classDef ext fill:#fff,stroke:#666,color:#000,stroke-dasharray: 5 5
O["Logical disjunction · or<br/>🟢7"]:::ok
subgraph G_ds["Dataset"]
direction LR
v_ds_ds["DS or DS"]:::ok
v_ds_sc["DS or sc"]:::ok
v_sc_ds["sc or DS"]:::ok
end
subgraph G_comp["Component"]
direction LR
v_comp_comp["comp or comp"]:::ok
v_comp_sc["comp or sc"]:::ok
v_sc_comp["sc or comp"]:::ok
end
subgraph G_sc["Scalar"]
direction LR
v_sc_sc["sc or sc"]:::ok
end
O --- G_ds
O --- G_comp
O --- G_sc
style G_ds fill:#f8f9fa,stroke:#495057,stroke-width:2px
style G_comp fill:#f8f9fa,stroke:#495057,stroke-width:2px,stroke-dasharray: 8 5
style G_sc fill:#f8f9fa,stroke:#495057,stroke-width:2px,stroke-dasharray: 2 3
click v_ds_ds href "#form-ds-ds"
click v_ds_sc href "#form-ds-sc"
click v_sc_ds href "#form-sc-ds"
click v_comp_comp href "#form-comp-comp"
click v_comp_sc href "#form-comp-sc"
click v_sc_comp href "#form-sc-comp"
click v_sc_sc href "#form-sc-sc"
Types
Takes boolean · Gives boolean
Comes from · boolean — 19 operators in 4 blocks 🟢19
General purpose operators (1) 🟢1
Comparison operators (12) 🟢12
Boolean operators (3) 🟢3
Data validation operators (3) 🟢3
Comes from · operators that return any type (their input's) — 38 operators in 8 blocks 🟢38
General purpose operators (6) 🟢6
Join operators (4) 🟢4
Time operators (3) 🟢3
Set operators (4) 🟢4
Hierarchical aggregation (1) 🟢1
Aggregate and Analytic operators (8) 🟢8
Conditional operators (3) 🟢3
Goes to · boolean — 26 operators in 8 blocks 🟢26
General purpose operators (1) 🟢1
Join operators (4) 🟢4
Boolean operators (3) 🟢3
Aggregate and Analytic operators (10) 🟢10
Data validation operators (1) 🟢1
Conditional operators (2) 🟢2
Clause operators (2) 🟢2
Definitions (VTL-DL) (3) 🟢3
Goes to · operators that take any scalar — 38 operators in 8 blocks 🟢38
General purpose operators (6) 🟢6
Comparison operators (11) 🟢11
Set operators (4) 🟢4
Aggregate and Analytic operators (7) 🟢7
Data validation operators (1) 🟢1
Conditional operators (1) 🟢1
Clause operators (7) 🟢7
Definitions (VTL-DL) (1) 🟢1
Forms
DS or DS 🟢 · boolean → boolean
Manual example 1 🟢 pandas ✅ · DuckDB ✅
- Tests:
DS_1 or DS_2on two data sets with the same identifiers and one boolean measure.- Manual:
Logical disjunction, Example 1, output verbatim: “The or operator returns true if at least one of the operands is true, otherwise false.”
- Expected:
the page’s six data points:
Me_1is false only for (F, 64, U, 2013), where both operands are false.
DS_r:= DS_1 or DS_2;
| 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 |
| 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 |
| 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 |
Files: script.vtl · input/DS_1.csv · input/DS_1.json · input/DS_2.csv · input/DS_2.json · expected/DS_r.csv · expected/DS_r.json · example page ↗
Null operands and uncoupled point 🟢 pandas ✅ · DuckDB ✅
- Tests:
DS_1 or DS_2: each of the four shared data points has a null operand, on the left for ids 1 and 4 and on the right for ids 2 and 3, andDS_2has an id 5 thatDS_1lacks.- Manual:
Logical disjunction: “
false or nullgivesnull”, “true or nullgivestrue” and “null or nullgivesnull”; the page’s sentence “returns true if at least one of the operands is true, otherwise false” conflicts with its null rows (false or nullis null, not false), and the listed rows govern. “Data Points that are not coupled are left out (the inner join is used)” (Typical behaviours of the ML Operators).- Expected:
Me_1is null, true, null and true for ids 1 to 4, and there is no data point for id 5.null or falseis null andnull or trueis true: a null on the left is not listed on the page, and follows from the three-valued logic of the User Manual (“VTL adopts 3VL”).
DS_r := DS_1 or DS_2;
| Id_1 | Me_1 |
|---|---|
| 1 | |
| 2 | true |
| 3 | false |
| 4 |
| Id_1 | Me_1 |
|---|---|
| 1 | false |
| 2 | |
| 3 | |
| 4 | true |
| 5 | true |
| Id_1 | Me_1 |
|---|---|
| 1 | |
| 2 | true |
| 3 | |
| 4 | true |
Files: script.vtl · input/DS_1.csv · input/DS_1.json · input/DS_2.csv · input/DS_2.json · expected/DS_r.csv · expected/DS_r.json · example page ↗
DS or sc 🟢 · boolean → boolean
False keeps the other operand 🟢 pandas ✅ · DuckDB ✅
- Tests:
DS_1 or false: a data set withMe_1true, false and null, and the boolean scalar false.- Manual:
Logical disjunction: “
false or nullgivesnull”, “true or nullgivestrue” and “null or nullgivesnull”; the page’s sentence “returns true if at least one of the operands is true, otherwise false” conflicts with its null rows (false or nullis null, not false), and the listed rows govern.- Expected:
Me_1is true, false and null, as inDS_1:falseleaves the other operand as it is, and null stays null.null or falseis null: a null on the left is not listed on the page, and follows from the three-valued logic of the User Manual (“VTL adopts 3VL”).
DS_r := DS_1 or false;
| Id_1 | Me_1 |
|---|---|
| 1 | true |
| 2 | false |
| 3 |
| Id_1 | Me_1 |
|---|---|
| 1 | true |
| 2 | false |
| 3 |
Files: script.vtl · input/DS_1.csv · input/DS_1.json · expected/DS_r.csv · expected/DS_r.json · example page ↗
True decides even over null 🟢 pandas ✅ · DuckDB ✅
- Tests:
DS_1 or true: a data set withMe_1true, false and null, and the boolean scalar true.- Manual:
Logical disjunction: “
false or nullgivesnull”, “true or nullgivestrue” and “null or nullgivesnull”; the page’s sentence “returns true if at least one of the operands is true, otherwise false” conflicts with its null rows (false or nullis null, not false), and the listed rows govern.- Expected:
Me_1is true on all three data points:truedecides the result whatever the other operand is, null included.null or trueis true: a null on the left is not listed on the page, and follows from the three-valued logic of the User Manual (“VTL adopts 3VL”).
DS_r := DS_1 or true;
| Id_1 | Me_1 |
|---|---|
| 1 | true |
| 2 | false |
| 3 |
| Id_1 | Me_1 |
|---|---|
| 1 | true |
| 2 | true |
| 3 | true |
Files: script.vtl · input/DS_1.csv · input/DS_1.json · expected/DS_r.csv · expected/DS_r.json · example page ↗
sc or DS 🟢 · boolean → boolean
False keeps the other operand 🟢 pandas ✅ · DuckDB ✅
- Tests:
false or DS_1: the boolean scalar false on the left, and a data set withMe_1true, false and null.- Manual:
Logical disjunction: “
false or nullgivesnull”, “true or nullgivestrue” and “null or nullgivesnull”; the page’s sentence “returns true if at least one of the operands is true, otherwise false” conflicts with its null rows (false or nullis null, not false), and the listed rows govern.- Expected:
Me_1is true, false and null, as inDS_1:falseleaves the other operand as it is, and null stays null (false or nullis null).
DS_r := false or DS_1;
| Id_1 | Me_1 |
|---|---|
| 1 | true |
| 2 | false |
| 3 |
| Id_1 | Me_1 |
|---|---|
| 1 | true |
| 2 | false |
| 3 |
Files: script.vtl · input/DS_1.csv · input/DS_1.json · expected/DS_r.csv · expected/DS_r.json · example page ↗
True decides even over null 🟢 pandas ✅ · DuckDB ✅
- Tests:
true or DS_1: the boolean scalar true on the left, and a data set withMe_1true, false and null.- Manual:
Logical disjunction: “
false or nullgivesnull”, “true or nullgivestrue” and “null or nullgivesnull”; the page’s sentence “returns true if at least one of the operands is true, otherwise false” conflicts with its null rows (false or nullis null, not false), and the listed rows govern.- Expected:
Me_1is true on all three data points:truedecides the result whatever the other operand is, null included (true or nullis true).
DS_r := true or DS_1;
| Id_1 | Me_1 |
|---|---|
| 1 | true |
| 2 | false |
| 3 |
| Id_1 | Me_1 |
|---|---|
| 1 | true |
| 2 | true |
| 3 | true |
Files: script.vtl · input/DS_1.csv · input/DS_1.json · expected/DS_r.csv · expected/DS_r.json · example page ↗
comp or comp 🟢 · boolean → boolean
All four boolean combinations 🟢 pandas ✅ · DuckDB ✅
- Tests:
DS_1[calc Me_3 := Me_1 or Me_2]: ids 1 to 4 hold the four combinations of two boolean values.- Manual:
Logical disjunction: “The or operator returns true if at least one of the operands is true, otherwise false.”
- Expected:
Me_3is false only for id 4, where both operands are false, and true for ids 1 to 3.
DS_r := DS_1[calc Me_3 := Me_1 or Me_2];
| Id_1 | Me_1 | Me_2 |
|---|---|---|
| 1 | true | true |
| 2 | true | false |
| 3 | false | true |
| 4 | false | false |
| Id_1 | Me_1 | Me_2 | Me_3 |
|---|---|---|---|
| 1 | true | true | true |
| 2 | true | false | true |
| 3 | false | true | true |
| 4 | false | false | false |
Files: script.vtl · input/DS_1.csv · input/DS_1.json · expected/DS_r.csv · expected/DS_r.json · example page ↗
Null on either side 🟢 pandas ✅ · DuckDB ✅
- Tests:
DS_1[calc Me_3 := Me_1 or Me_2]where every data point has a null operand, on the left for ids 1 and 4 and on the right for ids 2 and 3.- Manual:
Logical disjunction: “
false or nullgivesnull”, “true or nullgivestrue” and “null or nullgivesnull”; the page’s sentence “returns true if at least one of the operands is true, otherwise false” conflicts with its null rows (false or nullis null, not false), and the listed rows govern.- Expected:
Me_3is null, true, null and true for ids 1 to 4.null or falseis null andnull or trueis true: a null on the left is not listed on the page, and follows from the three-valued logic of the User Manual (“VTL adopts 3VL”).
DS_r := DS_1[calc Me_3 := Me_1 or Me_2];
| Id_1 | Me_1 | Me_2 |
|---|---|---|
| 1 | false | |
| 2 | true | |
| 3 | false | |
| 4 | true |
| Id_1 | Me_1 | Me_2 | Me_3 |
|---|---|---|---|
| 1 | false | ||
| 2 | true | true | |
| 3 | false | ||
| 4 | true | true |
Files: script.vtl · input/DS_1.csv · input/DS_1.json · expected/DS_r.csv · expected/DS_r.json · example page ↗
comp or sc 🟢 · boolean → boolean
Manual example 2 🟢 pandas ✅ · DuckDB ✅
- Tests:
DS_1 [ calc Me_2 := Me_1 or true ]: a new measure from a component and the boolean scalar true.- Manual:
Logical disjunction, Example 2, output verbatim: “The or operator returns true if at least one of the operands is true, otherwise false.”
- Expected:
the page’s six data points:
Me_2is true on each one, asor trueis true whatever the other operand is.
DS_r:= DS_1 [ calc Me_2:= Me_1 or true ];
| 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 |
| 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 |
Files: script.vtl · input/DS_1.csv · input/DS_1.json · expected/DS_r.csv · expected/DS_r.json · example page ↗
False keeps the other operand 🟢 pandas ✅ · DuckDB ✅
- Tests:
DS_1[calc Me_2 := Me_1 or false]: a componentMe_1that is true, false and null, and the boolean scalar false.- Manual:
Logical disjunction: “
false or nullgivesnull”, “true or nullgivestrue” and “null or nullgivesnull”; the page’s sentence “returns true if at least one of the operands is true, otherwise false” conflicts with its null rows (false or nullis null, not false), and the listed rows govern.- Expected:
Me_2is true, false and null, as inMe_1:falseleaves the other operand as it is, and null stays null.null or falseis null: a null on the left is not listed on the page, and follows from the three-valued logic of the User Manual (“VTL adopts 3VL”).
DS_r := DS_1[calc Me_2 := Me_1 or false];
| Id_1 | Me_1 |
|---|---|
| 1 | true |
| 2 | false |
| 3 |
| Id_1 | Me_1 | Me_2 |
|---|---|---|
| 1 | true | true |
| 2 | false | false |
| 3 |
Files: script.vtl · input/DS_1.csv · input/DS_1.json · expected/DS_r.csv · expected/DS_r.json · example page ↗
True decides even over null 🟢 pandas ✅ · DuckDB ✅
- Tests:
DS_1[calc Me_2 := Me_1 or true]: a componentMe_1that is true, false and null, and the boolean scalar true.- Manual:
Logical disjunction: “
false or nullgivesnull”, “true or nullgivestrue” and “null or nullgivesnull”; the page’s sentence “returns true if at least one of the operands is true, otherwise false” conflicts with its null rows (false or nullis null, not false), and the listed rows govern.- Expected:
Me_2is true on all three data points:truedecides the result whatever the other operand is, null included.null or trueis true: a null on the left is not listed on the page, and follows from the three-valued logic of the User Manual (“VTL adopts 3VL”).
DS_r := DS_1[calc Me_2 := Me_1 or true];
| Id_1 | Me_1 |
|---|---|
| 1 | true |
| 2 | false |
| 3 |
| Id_1 | Me_1 | Me_2 |
|---|---|---|
| 1 | true | true |
| 2 | false | true |
| 3 | true |
Files: script.vtl · input/DS_1.csv · input/DS_1.json · expected/DS_r.csv · expected/DS_r.json · example page ↗
sc or comp 🟢 · boolean → boolean
False keeps the other operand 🟢 pandas ✅ · DuckDB ✅
- Tests:
DS_1[calc Me_2 := false or Me_1]: the boolean scalar false on the left, and a componentMe_1that is true, false and null.- Manual:
Logical disjunction: “
false or nullgivesnull”, “true or nullgivestrue” and “null or nullgivesnull”; the page’s sentence “returns true if at least one of the operands is true, otherwise false” conflicts with its null rows (false or nullis null, not false), and the listed rows govern.- Expected:
Me_2is true, false and null, as inMe_1:falseleaves the other operand as it is, and null stays null (false or nullis null).
DS_r := DS_1[calc Me_2 := false or Me_1];
| Id_1 | Me_1 |
|---|---|
| 1 | true |
| 2 | false |
| 3 |
| Id_1 | Me_1 | Me_2 |
|---|---|---|
| 1 | true | true |
| 2 | false | false |
| 3 |
Files: script.vtl · input/DS_1.csv · input/DS_1.json · expected/DS_r.csv · expected/DS_r.json · example page ↗
True decides even over null 🟢 pandas ✅ · DuckDB ✅
- Tests:
DS_1[calc Me_2 := true or Me_1]: the boolean scalar true on the left, and a componentMe_1that is true, false and null.- Manual:
Logical disjunction: “
false or nullgivesnull”, “true or nullgivestrue” and “null or nullgivesnull”; the page’s sentence “returns true if at least one of the operands is true, otherwise false” conflicts with its null rows (false or nullis null, not false), and the listed rows govern.- Expected:
Me_2is true on all three data points:truedecides the result whatever the other operand is, null included (true or nullis true).
DS_r := DS_1[calc Me_2 := true or Me_1];
| Id_1 | Me_1 |
|---|---|
| 1 | true |
| 2 | false |
| 3 |
| Id_1 | Me_1 | Me_2 |
|---|---|---|
| 1 | true | true |
| 2 | false | true |
| 3 | true |
Files: script.vtl · input/DS_1.csv · input/DS_1.json · expected/DS_r.csv · expected/DS_r.json · example page ↗
sc or sc 🟢 · boolean → boolean
All four boolean combinations 🟢 pandas ✅ · DuckDB ✅
- Tests:
the four combinations of two boolean scalars:
SC_true or SC_true,SC_true or SC_false,SC_false or SC_trueandSC_false or SC_false, withSC_true= true andSC_false= false.- Manual:
Logical disjunction: “The or operator returns true if at least one of the operands is true, otherwise false.”
- Expected:
SC_1,SC_2andSC_3are true andSC_4is false, all Booleans.
SC_1 := SC_true or SC_true;
SC_2 := SC_true or SC_false;
SC_3 := SC_false or SC_true;
SC_4 := SC_false or SC_false;
| SC_true | SC_false |
|---|---|
| true | false |
Name |
Type |
Value |
|---|---|---|
|
Boolean |
|
|
Boolean |
|
|
Boolean |
|
|
Boolean |
|
Files: script.vtl · input/scalars.csv · input/scalars.json · expected/scalars.json · example page ↗
One null operand on either side 🟢 pandas ✅ · DuckDB ✅
- Tests:
one null operand, on the right or on the left:
SC_true or SC_null,SC_null or SC_true,SC_false or SC_nullandSC_null or SC_false, withSC_true= true,SC_null= null andSC_false= false.- Manual:
Logical disjunction: “
false or nullgivesnull”, “true or nullgivestrue” and “null or nullgivesnull”; the page’s sentence “returns true if at least one of the operands is true, otherwise false” conflicts with its null rows (false or nullis null, not false), and the listed rows govern.- Expected:
SC_1andSC_2are true,SC_3andSC_4are null, all Booleans.null or trueandnull or false, the cases ofSC_2andSC_4, are not listed on the page, and follow from the three-valued logic of the User Manual (“VTL adopts 3VL”).
SC_1 := SC_true or SC_null;
SC_2 := SC_null or SC_true;
SC_3 := SC_false or SC_null;
SC_4 := SC_null or SC_false;
| SC_true | SC_null | SC_false |
|---|---|---|
| true | false |
Name |
Type |
Value |
|---|---|---|
|
Boolean |
|
|
Boolean |
|
|
Boolean |
|
|
Boolean |
|
Files: script.vtl · input/scalars.csv · input/scalars.json · expected/scalars.json · example page ↗
Both operands null 🟢 pandas ✅ · DuckDB ✅
- Tests:
SC_1 or SC_2with both operands null:SC_1andSC_2are null Booleans.- Manual:
Logical disjunction: “
false or nullgivesnull”, “true or nullgivestrue” and “null or nullgivesnull”; the page’s sentence “returns true if at least one of the operands is true, otherwise false” conflicts with its null rows (false or nullis null, not false), and the listed rows govern.- Expected:
SC_ris null, a Boolean, as in the row “null or nullgivesnull”.
SC_r := SC_1 or SC_2;
| SC_1 | SC_2 |
|---|---|
Name |
Type |
Value |
|---|---|---|
|
Boolean |
|
Files: script.vtl · input/scalars.csv · input/scalars.json · expected/scalars.json · example page ↗