Non-persistent assignment · :=
---
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["Non-persistent assignment · #58;#61;<br/>🟢2"]:::ok
subgraph G_ds["Dataset"]
direction LR
v_ds["DS_r #58;#61; DS"]:::ok
end
subgraph G_sc["Scalar"]
direction LR
v_sc["SC_r #58;#61; sc"]:::ok
end
O --- G_ds
O --- G_sc
style G_ds fill:#f8f9fa,stroke:#495057,stroke-width:2px
style G_sc fill:#f8f9fa,stroke:#495057,stroke-width:2px,stroke-dasharray: 2 3
click v_ds href "#form-ds"
click v_sc href "#form-sc"
Types
Takes any scalar · Gives any type
Comes from: any operator that returns a value
Goes to: whatever takes its input's type
Forms
DS_r := DS 🟢 · any scalar → any type
Manual example 1 🟢 pandas ✅ · DuckDB ✅
- Tests:
DS_r := DS_1: a dataset assigned as it is to a non-persistent result.- Manual:
Non-persistent assignment, Example 1, output verbatim: “The result re is a non-persistent Data Set that has the same data structure as the Operand.”
- Expected:
DS_rhas the structure and the data points ofDS_1.
DS_r := DS_1;
| Id_1 | Id_2 | Me_1 | Me_2 |
|---|---|---|---|
| 2013 | Belgium | 5 | 5 |
| 2013 | Denmark | 2 | 10 |
| 2013 | France | 3 | 12 |
| 2013 | Spain | 4 | 20 |
| Id_1 | Id_2 | Me_1 | Me_2 |
|---|---|---|---|
| 2013 | Belgium | 5 | 5 |
| 2013 | Denmark | 2 | 10 |
| 2013 | France | 3 | 12 |
| 2013 | Spain | 4 | 20 |
Files: script.vtl · input/DS_1.csv · input/DS_1.json · expected/DS_r.csv · expected/DS_r.json · example page ↗
Number measure 🟢 pandas ✅ · DuckDB ✅
- Tests:
DS_r := DS_1on a Number measure: a decimal number,1.5, a negative one,-2.25, and a null, which vtlengine loads, keeps and writes as they are.- Manual:
Non-persistent assignment: “The result re is a non-persistent Data Set that has the same data structure as the Operand.”
- Expected:
DS_1as it is: every value comes back as it went in, the null included, and the structure keepsId_1not nullable andMe_1nullable.
DS_r := DS_1;
| Id_1 | Me_1 |
|---|---|
| 1 | 1.5 |
| 2 | -2.25 |
| 3 |
| Id_1 | Me_1 |
|---|---|
| 1 | 1.5 |
| 2 | -2.25 |
| 3 |
Files: script.vtl · input/DS_1.csv · input/DS_1.json · expected/DS_r.csv · expected/DS_r.json · example page ↗
Integer measure 🟢 pandas ✅ · DuckDB ✅
- Tests:
DS_r := DS_1on an Integer measure: a whole number,10, a negative one,-3, and a null, which vtlengine loads, keeps and writes as they are.- Manual:
Non-persistent assignment: “The result re is a non-persistent Data Set that has the same data structure as the Operand.”
- Expected:
DS_1as it is: every value comes back as it went in, the null included, and the structure keepsId_1not nullable andMe_1nullable.
DS_r := DS_1;
| Id_1 | Me_1 |
|---|---|
| 1 | 10 |
| 2 | -3 |
| 3 |
| Id_1 | Me_1 |
|---|---|
| 1 | 10 |
| 2 | -3 |
| 3 |
Files: script.vtl · input/DS_1.csv · input/DS_1.json · expected/DS_r.csv · expected/DS_r.json · example page ↗
String measure 🟢 pandas ✅ · DuckDB ✅
- Tests:
DS_r := DS_1on a String measure: two strings,alphaandbeta, and a null, which vtlengine loads, keeps and writes as they are.- Manual:
Non-persistent assignment: “The result re is a non-persistent Data Set that has the same data structure as the Operand.”
- Expected:
DS_1as it is: every value comes back as it went in, the null included, and the structure keepsId_1not nullable andMe_1nullable.
DS_r := DS_1;
| Id_1 | Me_1 |
|---|---|
| 1 | alpha |
| 2 | beta |
| 3 |
| Id_1 | Me_1 |
|---|---|
| 1 | alpha |
| 2 | beta |
| 3 |
Files: script.vtl · input/DS_1.csv · input/DS_1.json · expected/DS_r.csv · expected/DS_r.json · example page ↗
Boolean measure 🟢 pandas ✅ · DuckDB ✅
- Tests:
DS_r := DS_1on a Boolean measure: the two boolean values,trueandfalse, and a null, which vtlengine loads, keeps and writes as they are.- Manual:
Non-persistent assignment: “The result re is a non-persistent Data Set that has the same data structure as the Operand.”
- Expected:
DS_1as it is: every value comes back as it went in, the null included, and the structure keepsId_1not nullable andMe_1nullable.
DS_r := DS_1;
| Id_1 | Me_1 |
|---|---|
| 1 | true |
| 2 | false |
| 3 |
| Id_1 | Me_1 |
|---|---|
| 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 ↗
Time measure 🟢 pandas ✅ · DuckDB ✅
- Tests:
DS_r := DS_1on a Time measure: two intervals written in ISO 8601,2020-01-01/2020-12-31and2021-01-01/2021-06-30, and a null, which vtlengine loads, keeps and writes as they are.- Manual:
Non-persistent assignment: “The result re is a non-persistent Data Set that has the same data structure as the Operand.”
- Expected:
DS_1as it is: every value comes back as it went in, the null included, and the structure keepsId_1not nullable andMe_1nullable.
DS_r := DS_1;
| Id_1 | Me_1 |
|---|---|
| 1 | 2020-01-01/2020-12-31 |
| 2 | 2021-01-01/2021-06-30 |
| 3 |
| Id_1 | Me_1 |
|---|---|
| 1 | 2020-01-01/2020-12-31 |
| 2 | 2021-01-01/2021-06-30 |
| 3 |
Files: script.vtl · input/DS_1.csv · input/DS_1.json · expected/DS_r.csv · expected/DS_r.json · example page ↗
Date measure 🟢 pandas ✅ · DuckDB ✅
- Tests:
DS_r := DS_1on a Date measure: two dates,2020-01-15and2021-12-31, and a null, which vtlengine loads, keeps and writes as they are.- Manual:
Non-persistent assignment: “The result re is a non-persistent Data Set that has the same data structure as the Operand.”
- Expected:
DS_1as it is: every value comes back as it went in, the null included, and the structure keepsId_1not nullable andMe_1nullable.
DS_r := DS_1;
| Id_1 | Me_1 |
|---|---|
| 1 | 2020-01-15 |
| 2 | 2021-12-31 |
| 3 |
| Id_1 | Me_1 |
|---|---|
| 1 | 2020-01-15 |
| 2 | 2021-12-31 |
| 3 |
Files: script.vtl · input/DS_1.csv · input/DS_1.json · expected/DS_r.csv · expected/DS_r.json · example page ↗
Time period measure 🟢 pandas ✅ · DuckDB ✅
- Tests:
DS_r := DS_1on a Time_Period measure: two quarters,2020Q1and2020Q2, and a null, which vtlengine loads, keeps and writes as they are.- Manual:
Non-persistent assignment: “The result re is a non-persistent Data Set that has the same data structure as the Operand.”
- Expected:
DS_1as it is: every value comes back as it went in, the null included, and the structure keepsId_1not nullable andMe_1nullable.
DS_r := DS_1;
| Id_1 | Me_1 |
|---|---|
| 1 | 2020Q1 |
| 2 | 2020Q2 |
| 3 |
| Id_1 | Me_1 |
|---|---|
| 1 | 2020Q1 |
| 2 | 2020Q2 |
| 3 |
Files: script.vtl · input/DS_1.csv · input/DS_1.json · expected/DS_r.csv · expected/DS_r.json · example page ↗
Duration measure 🟢 pandas ✅ · DuckDB ✅
- Tests:
DS_r := DS_1on a Duration measure: an annual and a monthly duration,AandM, and a null, which vtlengine loads, keeps and writes as they are.- Manual:
Non-persistent assignment: “The result re is a non-persistent Data Set that has the same data structure as the Operand.”
- Expected:
DS_1as it is: every value comes back as it went in, the null included, and the structure keepsId_1not nullable andMe_1nullable.
DS_r := DS_1;
| Id_1 | Me_1 |
|---|---|
| 1 | A |
| 2 | M |
| 3 |
| Id_1 | Me_1 |
|---|---|
| 1 | A |
| 2 | M |
| 3 |
Files: script.vtl · input/DS_1.csv · input/DS_1.json · expected/DS_r.csv · expected/DS_r.json · example page ↗
SC_r := sc 🟢 · any scalar → any type
Integer literal 🟢 pandas ✅ · DuckDB ✅
- Tests:
SC_r := 3: a scalar assigned to a non-persistent result.- Manual:
Non-persistent assignment: “If the Operand
opis a scalar value, the result Data Set has no Components and contains only such a scalar value. For example,income := 3assigns the value3to the non-persistent Data Set namedincome.”- Expected:
SC_r = 3, an Integer.
SC_r := 3;
Name |
Type |
Value |
|---|---|---|
|
Integer |
|
Files: script.vtl · expected/scalars.json · example page ↗
Input value 🟢 pandas ✅ · DuckDB ✅
- Tests:
SC_r := SC_1with the input scalarSC_1= 3: a scalar read from the input, assigned to a non-persistent result.- Manual:
Non-persistent assignment: “If the Operand
opis a scalar value, the result Data Set has no Components and contains only such a scalar value. For example,income := 3assigns the value3to the non-persistent Data Set namedincome.”- Expected:
SC_r = 3, an Integer: the value ofSC_1.
SC_r := SC_1;
| SC_1 |
|---|
| 3 |
Name |
Type |
Value |
|---|---|---|
|
Integer |
|
Files: script.vtl · input/scalars.csv · input/scalars.json · expected/scalars.json · example page ↗