Not element of · not_in
---
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["Not element of · not_in<br/>🟢5"]:::ok
subgraph G_ds["Dataset"]
direction LR
v_ds_set["DS not_in set"]:::ok
v_ds_value_domain["DS not_in value domain"]:::ok
end
subgraph G_comp["Component"]
direction LR
v_comp_set["comp not_in set"]:::ok
v_comp_value_domain["comp not_in value domain"]:::ok
end
subgraph G_sc["Scalar"]
direction LR
v_sc_set["sc not_in set"]:::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_set href "#form-ds-set"
click v_comp_set href "#form-comp-set"
click v_sc_set href "#form-sc-set"
click v_ds_value_domain href "#form-ds-value-domain"
click v_comp_value_domain href "#form-comp-value-domain"
Types
Takes set, value domain, any scalar · Gives boolean
Comes from: any operator that returns a value
Comes from · set, value domain: none
Goes to · boolean — 27 operators in 8 blocks 🟢27
General purpose operators (1) 🟢1
Join operators (4) 🟢4
Boolean operators (4) 🟢4
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 — 37 operators in 8 blocks 🟢37
General purpose operators (6) 🟢6
Comparison operators (10) 🟢10
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 not_in set 🟢 · any scalar, set → boolean
Members and null operand 🟢 pandas ✅ · DuckDB ✅
- Tests:
DS_1 not_in { 0, 3, 6, 12 }: every measure value ofDS_1against a set literal, with two elements, a non-element and a null.- Manual:
Element of: “The not_in operator returns false if op belongs to the collection, true otherwise.” A null operand gives a null result: “Whenever a null value is involved in a comparison (>, <, >=, <=, in, not in, between) the result of the comparison is null” (User Manual).
- Expected:
bool_var, the page’s measure for a data set result, is false for 0, true for 4, false for 6 and null for the null measure.
DS_r := DS_1 not_in { 0, 3, 6, 12 };
| Id_1 | Me_1 |
|---|---|
| 1 | 0 |
| 2 | 4 |
| 3 | 6 |
| 4 |
| Id_1 | bool_var |
|---|---|
| 1 | false |
| 2 | true |
| 3 | false |
| 4 |
Files: script.vtl · input/DS_1.csv · input/DS_1.json · expected/DS_r.csv · expected/DS_r.json · example page ↗
DS not_in value domain 🟢 · any scalar, value domain → boolean
Members and null operand 🟢 pandas ✅ · DuckDB ✅
- Tests:
DS_1 not_in myGeoValueDomain: every measure value ofDS_1against a value domain, with the elementsAFandUG(the first and the last), the non-elementCQand a null.- Manual:
Element of: “The not_in operator returns false if op belongs to the collection, true otherwise.” The page defines the Value Domain
myGeoValueDomain(string) in the text before its examples, as{"AF", "BS", "FJ", "GA", "KH", "MO", "PK", "QA", "UG"}; it is passed torunasvalue_domains/myGeoValueDomain.json.- Expected:
bool_var, the page’s measure for a data set result, is false for AF, true for CQ, false for UG and null for the null measure. A null operand gives a null result: “Whenever a null value is involved in a comparison (>, <, >=, <=, in, not in, between) the result of the comparison is null” (User Manual).
DS_r := DS_1 not_in myGeoValueDomain;
| Id_1 | Me_1 |
|---|---|
| 1 | AF |
| 2 | CQ |
| 3 | UG |
| 4 |
| Id_1 | bool_var |
|---|---|
| 1 | false |
| 2 | true |
| 3 | false |
| 4 |
Files: script.vtl · input/DS_1.csv · input/DS_1.json · expected/DS_r.csv · expected/DS_r.json · value_domains/myGeoValueDomain.json · example page ↗
comp not_in set 🟢 · any scalar, set → boolean
Members and null operand 🟢 pandas ✅ · DuckDB ✅
- Tests:
Me_1 not_in { 0, 3, 6, 12 }insidecalc: two elements of the set, a non-element and a null.- Manual:
Element of: “The not_in operator returns false if op belongs to the collection, true otherwise.” A null operand gives a null result: “Whenever a null value is involved in a comparison (>, <, >=, <=, in, not in, between) the result of the comparison is null” (User Manual).
- Expected:
Me_2is a new boolean measure: false for 0, true for 4, false for 6 and null for the null;Me_1is kept.
DS_r := DS_1 [ calc Me_2 := Me_1 not_in { 0, 3, 6, 12 } ];
| Id_1 | Me_1 |
|---|---|
| 1 | 0 |
| 2 | 4 |
| 3 | 6 |
| 4 |
| Id_1 | Me_1 | Me_2 |
|---|---|---|
| 1 | 0 | false |
| 2 | 4 | true |
| 3 | 6 | false |
| 4 |
Files: script.vtl · input/DS_1.csv · input/DS_1.json · expected/DS_r.csv · expected/DS_r.json · example page ↗
comp not_in value domain 🟢 · any scalar, value domain → boolean
Members and null operand 🟢 pandas ✅ · DuckDB ✅
- Tests:
Me_1 not_in myGeoValueDomaininsidecalc: the elementsAFandUG(the first and the last of the value domain), the non-elementCQand a null.- Manual:
Element of: “The not_in operator returns false if op belongs to the collection, true otherwise.” The page defines the Value Domain
myGeoValueDomain(string) in the text before its examples, as{"AF", "BS", "FJ", "GA", "KH", "MO", "PK", "QA", "UG"}; it is passed torunasvalue_domains/myGeoValueDomain.json.- Expected:
Me_2is a new boolean measure: false for AF, true for CQ, false for UG and null for the null;Me_1is kept. A null operand gives a null result: “Whenever a null value is involved in a comparison (>, <, >=, <=, in, not in, between) the result of the comparison is null” (User Manual).
DS_r := DS_1 [ calc Me_2 := Me_1 not_in myGeoValueDomain ];
| Id_1 | Me_1 |
|---|---|
| 1 | AF |
| 2 | CQ |
| 3 | UG |
| 4 |
| Id_1 | Me_1 | Me_2 |
|---|---|---|
| 1 | AF | false |
| 2 | CQ | true |
| 3 | UG | false |
| 4 |
Files: script.vtl · input/DS_1.csv · input/DS_1.json · expected/DS_r.csv · expected/DS_r.json · value_domains/myGeoValueDomain.json · example page ↗
sc not_in set 🟢 · any scalar, set → boolean
Member of a set 🟢 pandas ✅ · DuckDB ✅
- Tests:
SC_1 not_in { "b", "hello", "c" }withSC_1="b": a scalar that is an element of a set literal.- Manual:
Element of, semantics for scalar operations: “``”b” not_in { “b”, “hello”, “c” }`` returns
false”.- Expected:
SC_r = false, a Boolean: b is an element of the set, sonot_inis false.
SC_r := SC_1 not_in { "b", "hello", "c" };
| SC_1 |
|---|
| b |
Name |
Type |
Value |
|---|---|---|
|
Boolean |
|
Files: script.vtl · input/scalars.csv · input/scalars.json · expected/scalars.json · example page ↗