← nvl operator page · conditional/nvl/ds_sc/manual_ex_1
pandas ✅ · DuckDB ✅
nvl ( DS_1, 0 ) on a data set: each null measure value becomes 0.
Nvl, Example 1, output verbatim: "The operator nvl returns the value from op2 when the value from op1 is null, otherwise it returns the value from op1." The page's TimePeriod type is written Time_Period, as vtlengine does.
Me_1 is 0 for S and N, where it is null, and unchanged for the other four.
DS_r := nvl ( DS_1, 0 );
| 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 | 417546 |
| 2012 | F | Total | Total | 5401267 |
| 2012 | N | Total | Total |
{
"datasets": [
{
"name": "DS_1",
"DataStructure": [
{"name": "Id_1", "type": "Time_Period", "role": "Identifier", "nullable": false},
{"name": "Id_2", "type": "String", "role": "Identifier", "nullable": false},
{"name": "Id_3", "type": "String", "role": "Identifier", "nullable": false},
{"name": "Id_4", "type": "String", "role": "Identifier", "nullable": false},
{"name": "Me_1", "type": "Integer", "role": "Measure", "nullable": true}
]
}
]
}
| Id_1 | Id_2 | Id_3 | Id_4 | Me_1 |
|---|---|---|---|---|
| 2012 | B | Total | Total | 11094850 |
| 2012 | G | Total | Total | 11123034 |
| 2012 | S | Total | Total | 0 |
| 2012 | M | Total | Total | 417546 |
| 2012 | F | Total | Total | 5401267 |
| 2012 | N | Total | Total | 0 |
{
"datasets": [
{
"name": "DS_r",
"DataStructure": [
{"name": "Id_1", "type": "Time_Period", "role": "Identifier"},
{"name": "Id_2", "type": "String", "role": "Identifier"},
{"name": "Id_3", "type": "String", "role": "Identifier"},
{"name": "Id_4", "type": "String", "role": "Identifier"},
{"name": "Me_1", "type": "Integer", "role": "Measure"}
]
}
]
}