Greater than · >
---
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["Greater than · #62;<br/>🟢7"]:::ok
subgraph G_ds["Dataset"]
direction LR
v_ds_ds["DS #62; DS"]:::ok
v_ds_sc["DS #62; sc"]:::ok
v_sc_ds["sc #62; DS"]:::ok
end
subgraph G_comp["Component"]
direction LR
v_comp_comp["comp #62; comp"]:::ok
v_comp_sc["comp #62; sc"]:::ok
v_sc_comp["sc #62; comp"]:::ok
end
subgraph G_sc["Scalar"]
direction LR
v_sc_sc["sc #62; 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 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
DS > DS 🟢 · any scalar → boolean
Manual example 3 🟢 pandas ✅ · DuckDB ✅
- Tests:
DS_2 > DS_3: the measures of two data sets, data point by data point.- Manual:
Greater than, Example 3, output verbatim: “The operator > returns true if left is greater than right, false otherwise.” The page adds that “if the Me_1 column for Germany in the DS_2 or DS_3 Data Set had a null value the result would be null for Germany (G)”.
- Expected:
bool_varis false for G (7.1 against 7.5) and true for R (42.5 against 33.7).
DS_r:= DS_2 > DS_3;
| Id_1 | Id_2 | Id_3 | Id_4 | Me_1 |
|---|---|---|---|---|
| G | Total | Percentage | Total | 7.1 |
| R | Total | Percentage | Total | 42.5 |
| Id_1 | Id_2 | Id_3 | Id_4 | Me_1 |
|---|---|---|---|---|
| G | Total | Percentage | Total | 7.5 |
| R | Total | Percentage | Total | 33.7 |
| Id_1 | Id_2 | Id_3 | Id_4 | bool_var |
|---|---|---|---|---|
| G | Total | Percentage | Total | false |
| R | Total | Percentage | Total | true |
Files: script.vtl · input/DS_2.csv · input/DS_2.json · input/DS_3.csv · input/DS_3.json · expected/DS_r.csv · expected/DS_r.json · example page ↗
DS > sc 🟢 · any scalar → boolean
Manual example 1 🟢 pandas ✅ · DuckDB ✅
- Tests:
DS_1 > 20: every measure value ofDS_1against a scalar, with a null measure.- Manual:
Greater than, Example 1, output verbatim: “The operator > returns true if left is greater than right, false otherwise.”
- Expected:
bool_varis true for F (29.5), false for R (12.2) and null for G, whose measure is null.
DS_r := DS_1 > 20;
| Id_1 | Id_2 | Id_3 | Id_4 | Id_5 | Me_1 |
|---|---|---|---|---|---|
| 2 | G | 2011 | Total | Percentage | |
| 2 | R | 2011 | Total | Percentage | 12.2 |
| 2 | F | 2011 | Total | Percentage | 29.5 |
| Id_1 | Id_2 | Id_3 | Id_4 | Id_5 | bool_var |
|---|---|---|---|---|---|
| 2 | G | 2011 | Total | Percentage | |
| 2 | R | 2011 | Total | Percentage | false |
| 2 | F | 2011 | Total | Percentage | true |
Files: script.vtl · input/DS_1.csv · input/DS_1.json · expected/DS_r.csv · expected/DS_r.json · example page ↗
sc > DS 🟢 · any scalar → boolean
Scalar first and null measure 🟢 pandas ✅ · DuckDB ✅
- Tests:
2 > DS_1, a scalar as the left operand, where one measure value equals it and one is null.- Manual:
Greater than: “The operator > returns true if left is greater than right, false 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 true, false, false and null for ids 1 to 4: 2 > 2 is false, as>excludes the equal value, and the null measure gives null.
DS_r := 2 > DS_1;
| Id_1 | Me_1 |
|---|---|
| 1 | 1 |
| 2 | 2 |
| 3 | 3 |
| 4 |
| Id_1 | bool_var |
|---|---|
| 1 | true |
| 2 | false |
| 3 | false |
| 4 |
Files: script.vtl · input/DS_1.csv · input/DS_1.json · expected/DS_r.csv · expected/DS_r.json · example page ↗
comp > comp 🟢 · any scalar → boolean
Two measures and null 🟢 pandas ✅ · DuckDB ✅
- Tests:
Me_1 > Me_2insidecalc: two measures of one data set, equal in one data point and with a nullMe_2in another.- Manual:
Greater than: “The operator > returns true if left is greater than right, false 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_3is a new boolean measure: false, false, true and null for ids 1 to 4; 2 > 2 is false, as>excludes the equal value, and id 4 compares 4 with a null;Me_1andMe_2are kept.
DS_r := DS_1 [ calc Me_3 := Me_1 > Me_2 ];
| Id_1 | Me_1 | Me_2 |
|---|---|---|
| 1 | 1 | 3 |
| 2 | 2 | 2 |
| 3 | 3 | 1 |
| 4 | 4 |
| Id_1 | Me_1 | Me_2 | Me_3 |
|---|---|---|---|
| 1 | 1 | 3 | false |
| 2 | 2 | 2 | false |
| 3 | 3 | 1 | true |
| 4 | 4 |
Files: script.vtl · input/DS_1.csv · input/DS_1.json · expected/DS_r.csv · expected/DS_r.json · example page ↗
comp > sc 🟢 · any scalar → boolean
Manual example 2 🟢 pandas ✅ · DuckDB ✅
- Tests:
Me_1 > 20insidecalc, where the new measureMe_2takes the result.- Manual:
Greater than, Example 2, output verbatim: “The operator > returns true if left is greater than right, false otherwise.”
- Expected:
Me_2is true for F, false for R and null for G, whoseMe_1is null;Me_1is kept.
DS_r := DS_1 [ calc Me_2 := Me_1 > 20 ];
| Id_1 | Id_2 | Id_3 | Id_4 | Id_5 | Me_1 |
|---|---|---|---|---|---|
| 2 | G | 2011 | Total | Percentage | |
| 2 | R | 2011 | Total | Percentage | 12.2 |
| 2 | F | 2011 | Total | Percentage | 29.5 |
| Id_1 | Id_2 | Id_3 | Id_4 | Id_5 | Me_1 | Me_2 |
|---|---|---|---|---|---|---|
| 2 | G | 2011 | Total | Percentage | ||
| 2 | R | 2011 | Total | Percentage | 12.2 | false |
| 2 | F | 2011 | Total | Percentage | 29.5 | true |
Files: script.vtl · input/DS_1.csv · input/DS_1.json · expected/DS_r.csv · expected/DS_r.json · example page ↗
sc > comp 🟢 · any scalar → boolean
Scalar first and null measure 🟢 pandas ✅ · DuckDB ✅
- Tests:
2 > Me_1insidecalc, a scalar as the left operand, where one measure value equals it and one is null.- Manual:
Greater than: “The operator > returns true if left is greater than right, false 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: true, false, false and null for ids 1 to 4; 2 > 2 is false, as>excludes the equal value, and the null measure gives null;Me_1is kept.
DS_r := DS_1 [ calc Me_2 := 2 > Me_1 ];
| Id_1 | Me_1 |
|---|---|
| 1 | 1 |
| 2 | 2 |
| 3 | 3 |
| 4 |
| Id_1 | Me_1 | Me_2 |
|---|---|---|
| 1 | 1 | true |
| 2 | 2 | false |
| 3 | 3 | false |
| 4 |
Files: script.vtl · input/DS_1.csv · input/DS_1.json · expected/DS_r.csv · expected/DS_r.json · example page ↗
sc > sc 🟢 · any scalar → boolean
Alphabetical string order 🟢 pandas ✅ · DuckDB ✅
- Tests:
SC_1 > SC_2withSC_1="hello"andSC_2="hi": two strings.- Manual:
Greater than, semantics for scalar operations: “``”hello” > “hi”`` gives
false”.- Expected:
SC_r = false, a Boolean, as the page gives it:hellosorts beforehi.
SC_r := SC_1 > SC_2;
| SC_1 | SC_2 |
|---|---|
| hello | hi |
Name |
Type |
Value |
|---|---|---|
|
Boolean |
|
Files: script.vtl · input/scalars.csv · input/scalars.json · expected/scalars.json · example page ↗