Check · check
---
config:
flowchart:
useMaxWidth: false
---
flowchart LR
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["Check · check<br/>🟢6"]:::ok
v_bare["check(B)"]:::ok
v_errorcode["check(B errorcode C)"]:::ok
v_errorlevel["check(B errorlevel L)"]:::ok
v_imbalance["check(B imbalance N)"]:::ok
v_invalid["check(B invalid)"]:::ok
v_all["check(B all)"]:::ok
v_bare --- O
v_errorcode --- O
v_errorlevel --- O
O --- v_imbalance
O --- v_invalid
O --- v_all
click v_bare href "#form-bare"
click v_errorcode href "#form-errorcode"
click v_errorlevel href "#form-errorlevel"
click v_imbalance href "#form-imbalance"
click v_invalid href "#form-invalid"
click v_all href "#form-all"
Types
Takes number, integer, string, boolean · Gives number, integer, string, boolean
Comes from · number, integer, string, boolean — 68 operators in 8 blocks 🟢68
General purpose operators (2) 🟢2
String operators (11) 🟢11
||Whitespace removal trimLeading whitespace removal ltrimTrailing whitespace removal rtrimUpper case conversion upperLower case conversion lowerSub-string extraction substrString pattern replacement replaceString pattern location instrString length lengthString distances string_distanceNumeric operators (18) 🟢18
Comparison operators (12) 🟢12
Boolean operators (4) 🟢4
Time operators (9) 🟢9
Aggregate and Analytic operators (10) 🟢10
Data validation operators (2) 🟢2
Comes from · operators that return any type (their input's) — 37 operators in 8 blocks 🟢37
General purpose operators (5) 🟢5
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 · number, integer, string, boolean — 68 operators in 13 blocks 🟢68
General purpose operators (1) 🟢1
Join operators (4) 🟢4
String operators (11) 🟢11
||Whitespace removal trimLeading whitespace removal ltrimTrailing whitespace removal rtrimUpper case conversion upperLower case conversion lowerSub-string extraction substrString pattern replacement replaceString pattern location instrString length lengthString distances string_distanceNumeric operators (18) 🟢18
Comparison operators (1) 🟢1
Boolean operators (4) 🟢4
Time operators (6) 🟢6
Hierarchical aggregation (1) 🟢1
Aggregate and Analytic operators (13) 🟢13
Data validation operators (1) 🟢1
Conditional operators (2) 🟢2
Clause operators (2) 🟢2
Definitions (VTL-DL) (4) 🟢4
Goes to · operators that take any scalar — 35 operators in 7 blocks 🟢35
General purpose operators (6) 🟢6
Comparison operators (11) 🟢11
Set operators (4) 🟢4
Aggregate and Analytic operators (5) 🟢5
Data validation operators (1) 🟢1
Conditional operators (1) 🟢1
Forms
check(B) 🟢 · boolean → boolean, number, string, integer
Every point returned by default 🟢 pandas ✅ · DuckDB ✅
- Tests:
check ( DS_1 > 0 )with no optional parameter, onMe_15, -3 and null, sobool_varis true, false and null.- Manual:
Check: “If not specified then output is all”, and “If not specified then imbalance is null”, and the same words hold for errorcode and errorlevel, the error code and level being “to be produced when the condition evaluates to false”.
- Expected:
all three data points,
bool_vartrue, false and null, with nullimbalance,errorcodeanderrorlevel.imbalanceis Number or Integer, its parameter’snumberor a subtype,errorcodeString anderrorlevelInteger, “or integer if the errorcode_vd Value Domain is not found”.
DS_r := check ( DS_1 > 0 );
| Id_1 | Me_1 |
|---|---|
| 1 | 5 |
| 2 | -3 |
| 3 |
| Id_1 | bool_var | imbalance | errorcode | errorlevel |
|---|---|---|---|---|
| 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 ↗
check(B errorcode C) 🟢 · string, boolean → boolean, number, string, integer
Code only on the false point 🟢 pandas ✅ · DuckDB ✅
- Tests:
check ( DS_1 > 0 errorcode "E1" )onMe_15, -3 and null, sobool_varis true, false and null.- Manual:
Check: errorcode is “the error code to be produced when the condition evaluates to false”, “or string if the errorcode_vd Value Domain is not found”, and “if the Measure bool_var is null then errorcode is null”.
- Expected:
all three data points, by the default output
all, with the StringerrorcodeE1on data point 2, the false one, and null on the true and the null ones.imbalanceanderrorlevelare null, as they are not specified:imbalanceis Number or Integer, its parameter’snumberor a subtype, anderrorlevelInteger, “or integer if the errorcode_vd Value Domain is not found”.
DS_r := check ( DS_1 > 0 errorcode "E1" );
| Id_1 | Me_1 |
|---|---|
| 1 | 5 |
| 2 | -3 |
| 3 |
| Id_1 | bool_var | imbalance | errorcode | errorlevel |
|---|---|---|---|---|
| 1 | true | |||
| 2 | false | E1 | ||
| 3 |
Files: script.vtl · input/DS_1.csv · input/DS_1.json · expected/DS_r.csv · expected/DS_r.json · example page ↗
check(B errorlevel L) 🟢 · integer, boolean → boolean, number, string, integer
Level only on the false point 🟢 pandas ✅ · DuckDB ✅
- Tests:
check ( DS_1 > 0 errorlevel 5 )onMe_15, -3 and null, sobool_varis true, false and null.- Manual:
Check: errorlevel is “the error level to be produced when the condition evaluates to false”, “or integer if the errorcode_vd Value Domain is not found”, and “if the Measure bool_var is null then errorlevel is null”.
- Expected:
all three data points, by the default output
all, with the Integererrorlevel5 on data point 2, the false one, and null on the true and the null ones.imbalanceanderrorcodeare null, as they are not specified:imbalanceis Number or Integer, its parameter’snumberor a subtype, anderrorcodeString.
DS_r := check ( DS_1 > 0 errorlevel 5 );
| Id_1 | Me_1 |
|---|---|
| 1 | 5 |
| 2 | -3 |
| 3 |
| Id_1 | bool_var | imbalance | errorcode | errorlevel |
|---|---|---|---|---|
| 1 | true | |||
| 2 | false | 5 | ||
| 3 |
Files: script.vtl · input/DS_1.csv · input/DS_1.json · expected/DS_r.csv · expected/DS_r.json · example page ↗
check(B imbalance N) 🟢 · number, boolean → boolean, number, string, integer
Manual example 1 🟢 pandas ✅ · DuckDB ✅
- Tests:
check ( DS_1 >= DS_2 imbalance DS_1 - DS_2 )with no output, on two data sets of 12 data points.- Manual:
Check, Example 1, output verbatim: the result has “the Measure imbalance that contains the specified imbalance”, and “If not specified then output is all”.
- Expected:
all 12 data points,
bool_varbeingDS_1 >= DS_2andimbalanceDS_1 - DS_2: false with -8, -3, -25 and -15 on 2010 I, 2013 I, 2010 D and 2014 D, true with 5 on 2012 D, and true with 0 where the two are equal.errorcodeanderrorlevelare null, as none is given.
DS_r := check ( DS_1 >= DS_2 imbalance DS_1 - DS_2 );
| Id_1 | Id_2 | Me_1 |
|---|---|---|
| 2010 | I | 1 |
| 2011 | I | 2 |
| 2012 | I | 10 |
| 2013 | I | 4 |
| 2014 | I | 5 |
| 2015 | I | 6 |
| 2010 | D | 25 |
| 2011 | D | 35 |
| 2012 | D | 45 |
| 2013 | D | 55 |
| 2014 | D | 50 |
| 2015 | D | 75 |
| Id_1 | Id_2 | Me_1 |
|---|---|---|
| 2010 | I | 9 |
| 2011 | I | 2 |
| 2012 | I | 10 |
| 2013 | I | 7 |
| 2014 | I | 5 |
| 2015 | I | 6 |
| 2010 | D | 50 |
| 2011 | D | 35 |
| 2012 | D | 40 |
| 2013 | D | 55 |
| 2014 | D | 65 |
| 2015 | D | 75 |
| Id_1 | Id_2 | bool_var | imbalance | errorcode | errorlevel |
|---|---|---|---|---|---|
| 2010 | I | false | -8 | ||
| 2011 | I | true | 0 | ||
| 2012 | I | true | 0 | ||
| 2013 | I | false | -3 | ||
| 2014 | I | true | 0 | ||
| 2015 | I | true | 0 | ||
| 2010 | D | false | -25 | ||
| 2011 | D | true | 0 | ||
| 2012 | D | true | 5 | ||
| 2013 | D | true | 0 | ||
| 2014 | D | false | -15 | ||
| 2015 | D | true | 0 |
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 ↗
check(B invalid) 🟢 · boolean → boolean, number, string, integer
Only the false point returned 🟢 pandas ✅ · DuckDB ✅
- Tests:
check ( DS_1 > 0 invalid )onMe_15, -3 and null, sobool_varis true, false and null.- Manual:
Check: “If output is invalid then only the Data Points where bool_var is false are returned”, and the result has “a boolean Measure named bool_var” with either output.
- Expected:
data point 2 only,
bool_varfalse, with nullimbalance,errorcodeanderrorlevel, as none is specified: “If not specified then imbalance is null”, and the same words hold for errorcode and errorlevel, the error code and level being “to be produced when the condition evaluates to false”.imbalanceis Number or Integer, its parameter’snumberor a subtype,errorcodeString anderrorlevelInteger, “or integer if the errorcode_vd Value Domain is not found”.
DS_r := check ( DS_1 > 0 invalid );
| Id_1 | Me_1 |
|---|---|
| 1 | 5 |
| 2 | -3 |
| 3 |
| Id_1 | bool_var | imbalance | errorcode | errorlevel |
|---|---|---|---|---|
| 2 | false |
Files: script.vtl · input/DS_1.csv · input/DS_1.json · expected/DS_r.csv · expected/DS_r.json · example page ↗
check(B all) 🟢 · boolean → boolean, number, string, integer
Explicit all same as default 🟢 pandas ✅ · DuckDB ✅
- Tests:
check ( DS_1 > 0 all ), the default output written out, onMe_15, -3 and null, sobool_varis true, false and null.- Manual:
Check: “all returns all Data Points of op”, as with no output: “If not specified then output is all”; “If not specified then imbalance is null”, and the same words hold for errorcode and errorlevel, the error code and level being “to be produced when the condition evaluates to false”.
- Expected:
the output of Every point returned by default, the
bareform: all three data points,bool_vartrue, false and null, with nullimbalance,errorcodeanderrorlevel.imbalanceis Number or Integer, its parameter’snumberor a subtype,errorcodeString anderrorlevelInteger, “or integer if the errorcode_vd Value Domain is not found”.
DS_r := check ( DS_1 > 0 all );
| Id_1 | Me_1 |
|---|---|
| 1 | 5 |
| 2 | -3 |
| 3 |
| Id_1 | bool_var | imbalance | errorcode | errorlevel |
|---|---|---|---|---|
| 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 ↗