Logical negation · not
---
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 negation · not<br/>🟢3"]:::ok
subgraph G_ds["Dataset"]
direction LR
v_ds["not DS"]:::ok
end
subgraph G_comp["Component"]
direction LR
v_comp["not comp"]:::ok
end
subgraph G_sc["Scalar"]
direction LR
v_sc["not 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 href "#form-ds"
click v_comp href "#form-comp"
click v_sc href "#form-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
not DS 🟢 · boolean → boolean
Manual example 1 🟢 pandas ✅ · DuckDB ✅
- Tests:
not DS_1on a data set with one boolean measure.- Manual:
Logical negation, Example 1, output verbatim: “
not falsegivestrue” and “not truegivesfalse”.- Expected:
the page’s six data points:
Me_1is the negation of the operand’sMe_1on each one.
DS_r:= not DS_1;
| 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 | false |
| F | 15 | U | 2013 | true |
| F | 64 | U | 2013 | true |
| F | 65 | U | 2013 | false |
Files: script.vtl · input/DS_1.csv · input/DS_1.json · expected/DS_r.csv · expected/DS_r.json · example page ↗
True false and null values 🟢 pandas ✅ · DuckDB ✅
- Tests:
not DS_1: a data set withMe_1true, false and null.- Manual:
Logical negation: “
not falsegivestrue”, “not truegivesfalse” and “not nullgivesnull”; the page’s sentence “returns true if op is false, otherwise true” has a typo (“otherwise true” would makenot truetrue) and ignores null, and the listed rows govern.- Expected:
Me_1is false, true and null:not trueis false,not falseis true andnot nullis null.
DS_r := not DS_1;
| Id_1 | Me_1 |
|---|---|
| 1 | true |
| 2 | false |
| 3 |
| Id_1 | Me_1 |
|---|---|
| 1 | false |
| 2 | true |
| 3 |
Files: script.vtl · input/DS_1.csv · input/DS_1.json · expected/DS_r.csv · expected/DS_r.json · example page ↗
not comp 🟢 · boolean → boolean
Manual example 2 🟢 pandas ✅ · DuckDB ✅
- Tests:
DS_1 [ calc Me_2 := not Me_1 ]: a new measure that negates the componentMe_1.- Manual:
Logical negation, Example 2, output verbatim: “
not falsegivestrue” and “not truegivesfalse”.- Expected:
the page’s six data points:
Me_1is kept andMe_2is its negation on each one.
DS_r:= DS_1 [ calc Me_2 := not Me_1 ];
| 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 | false |
| M | 64 | B | 2013 | false | true |
| M | 65 | B | 2013 | true | false |
| F | 15 | U | 2013 | false | true |
| F | 64 | U | 2013 | false | true |
| F | 65 | U | 2013 | true | false |
Files: script.vtl · input/DS_1.csv · input/DS_1.json · expected/DS_r.csv · expected/DS_r.json · example page ↗
True false and null values 🟢 pandas ✅ · DuckDB ✅
- Tests:
DS_1[calc Me_2 := not Me_1]: a componentMe_1that is true, false and null.- Manual:
Logical negation: “
not falsegivestrue”, “not truegivesfalse” and “not nullgivesnull”; the page’s sentence “returns true if op is false, otherwise true” has a typo (“otherwise true” would makenot truetrue) and ignores null, and the listed rows govern.- Expected:
Me_2is false, true and null:not trueis false,not falseis true andnot nullis null.
DS_r := DS_1[calc Me_2 := not Me_1];
| Id_1 | Me_1 |
|---|---|
| 1 | true |
| 2 | false |
| 3 |
| Id_1 | Me_1 | Me_2 |
|---|---|---|
| 1 | true | false |
| 2 | false | true |
| 3 |
Files: script.vtl · input/DS_1.csv · input/DS_1.json · expected/DS_r.csv · expected/DS_r.json · example page ↗
not sc 🟢 · boolean → boolean
True and false operands 🟢 pandas ✅ · DuckDB ✅
- Tests:
not SC_trueandnot SC_false: the two boolean values, withSC_true= true andSC_false= false.- Manual:
Logical negation: “
not falsegivestrue”, “not truegivesfalse” and “not nullgivesnull”; the page’s sentence “returns true if op is false, otherwise true” has a typo (“otherwise true” would makenot truetrue) and ignores null, and the listed rows govern.- Expected:
SC_1is false andSC_2is true, both Booleans.
SC_1 := not SC_true;
SC_2 := not SC_false;
| SC_true | SC_false |
|---|---|
| true | false |
Name |
Type |
Value |
|---|---|---|
|
Boolean |
|
|
Boolean |
|
Files: script.vtl · input/scalars.csv · input/scalars.json · expected/scalars.json · example page ↗
Null operand 🟢 pandas ✅ · DuckDB ✅
- Tests:
not SC_1withSC_1null: the operand is null.- Manual:
Logical negation: “
not falsegivestrue”, “not truegivesfalse” and “not nullgivesnull”; the page’s sentence “returns true if op is false, otherwise true” has a typo (“otherwise true” would makenot truetrue) and ignores null, and the listed rows govern.- Expected:
SC_ris null, a Boolean, as in the row “not nullgivesnull”.
SC_r := not SC_1;
| SC_1 |
|---|
Name |
Type |
Value |
|---|---|---|
|
Boolean |
|
Files: script.vtl · input/scalars.csv · input/scalars.json · expected/scalars.json · example page ↗