Is null · isnull
---
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["Is null · isnull<br/>🟢3"]:::ok
subgraph G_ds["Dataset"]
direction LR
v_ds["isnull(DS)"]:::ok
end
subgraph G_comp["Component"]
direction LR
v_comp["isnull(comp)"]:::ok
end
subgraph G_sc["Scalar"]
direction LR
v_sc["isnull(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 any scalar · Gives boolean
Comes from: any operator that returns a value
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
isnull(DS) 🟢 · any scalar → boolean
Manual example 1 🟢 pandas ✅ · DuckDB ✅
- Tests:
isnull(DS_1): the measure ofDS_1, with two null values.- Manual:
Is null, Example 1, output verbatim: “The operator returns true if the value of the operand is null, false otherwise.”
- Expected:
bool_varis true for S and W, whose measure is null, and false for B, G, M and F.
DS_r := isnull(DS_1);
| Id_1 | Id_2 | Id_3 | Id_4 | Me_1 |
|---|---|---|---|---|
| 2012 | B | Total | Total | 11094850 |
| 2012 | G | Total | Total | 11123034 |
| 2012 | S | Total | Total | |
| 2012 | M | Total | Total | 46818219 |
| 2012 | F | Total | Total | 5401267 |
| 2012 | W | Total | Total |
| Id_1 | Id_2 | Id_3 | Id_4 | bool_var |
|---|---|---|---|---|
| 2012 | B | Total | Total | false |
| 2012 | G | Total | Total | false |
| 2012 | S | Total | Total | true |
| 2012 | M | Total | Total | false |
| 2012 | F | Total | Total | false |
| 2012 | W | Total | Total | true |
Files: script.vtl · input/DS_1.csv · input/DS_1.json · expected/DS_r.csv · expected/DS_r.json · example page ↗
isnull(comp) 🟢 · any scalar → boolean
Manual example 2 🟢 pandas ✅ · DuckDB ✅
- Tests:
isnull(Me_1)insidecalc, where the new measureMe_2takes the result.- Manual:
Is null, Example 2, output verbatim: “The operator returns true if the value of the operand is null, false otherwise.”
- Expected:
Me_2is true for S and W, whoseMe_1is null, and false for B, G, M and F;Me_1is kept.
DS_r := DS_1[ calc Me_2 := isnull(Me_1) ];
| Id_1 | Id_2 | Id_3 | Id_4 | Me_1 |
|---|---|---|---|---|
| 2012 | B | Total | Total | 11094850 |
| 2012 | G | Total | Total | 11123034 |
| 2012 | S | Total | Total | |
| 2012 | M | Total | Total | 46818219 |
| 2012 | F | Total | Total | 5401267 |
| 2012 | W | Total | Total |
| Id_1 | Id_2 | Id_3 | Id_4 | Me_1 | Me_2 |
|---|---|---|---|---|---|
| 2012 | B | Total | Total | 11094850 | false |
| 2012 | G | Total | Total | 11123034 | false |
| 2012 | S | Total | Total | true | |
| 2012 | M | Total | Total | 46818219 | false |
| 2012 | F | Total | Total | 5401267 | false |
| 2012 | W | Total | Total | true |
Files: script.vtl · input/DS_1.csv · input/DS_1.json · expected/DS_r.csv · expected/DS_r.json · example page ↗
isnull(sc) 🟢 · any scalar → boolean
Null literal 🟢 pandas ✅ · DuckDB ✅
- Tests:
isnull(null): the null literal.- Manual:
Is null, semantics for scalar operations: “
isnull(null)givestrue”.- Expected:
SC_r = true, a Boolean: the operand is null.
SC_r := isnull(null);
Name |
Type |
Value |
|---|---|---|
|
Boolean |
|
Files: script.vtl · expected/scalars.json · example page ↗
Non null string 🟢 pandas ✅ · DuckDB ✅
- Tests:
isnull(SC_1)withSC_1="Hello": a string that is not null.- Manual:
Is null, semantics for scalar operations: “
isnull("Hello")givesfalse”.- Expected:
SC_r = false, a Boolean: the operand is not null.
SC_r := isnull(SC_1);
| SC_1 |
|---|
| Hello |
Name |
Type |
Value |
|---|---|---|
|
Boolean |
|
Files: script.vtl · input/scalars.csv · input/scalars.json · expected/scalars.json · example page ↗