← nvl operator page · conditional/nvl/ds_ds/partly_different_identifiers
pandas ✅ · DuckDB ✅
nvl ( DS_1, DS_2 ) on two data sets with the same components and partly different identifiers: id 1 is only in DS_1 and id 4 only in DS_2.
Nvl: "The operator has the typical behaviour of the operators applicable on two scalar values or Data Sets or Data Set Components", where "Data Points that are not coupled are left out" (Typical behaviours).
only ids 2 and 3 are coupled: id 2 is null in DS_1 and takes DS_2's 200; id 3 keeps its 30, and DS_2's 300 is not used.
DS_r := nvl ( DS_1, DS_2 );
| Id_1 | Me_1 |
|---|---|
| 1 | 10 |
| 2 | |
| 3 | 30 |
{
"datasets": [
{
"name": "DS_1",
"DataStructure": [
{"name": "Id_1", "type": "Integer", "role": "Identifier", "nullable": false},
{"name": "Me_1", "type": "Integer", "role": "Measure", "nullable": true}
]
}
]
}
| Id_1 | Me_1 |
|---|---|
| 2 | 200 |
| 3 | 300 |
| 4 | 400 |
{
"datasets": [
{
"name": "DS_2",
"DataStructure": [
{"name": "Id_1", "type": "Integer", "role": "Identifier", "nullable": false},
{"name": "Me_1", "type": "Integer", "role": "Measure", "nullable": true}
]
}
]
}
| Id_1 | Me_1 |
|---|---|
| 2 | 200 |
| 3 | 30 |
{
"datasets": [
{
"name": "DS_r",
"DataStructure": [
{"name": "Id_1", "type": "Integer", "role": "Identifier"},
{"name": "Me_1", "type": "Integer", "role": "Measure"}
]
}
]
}