← isnull operator page · comparison/isnull/comp/manual_ex_2
pandas ✅ · DuckDB ✅
isnull(Me_1) inside calc, where the new measure Me_2 takes the result.
Is null, Example 2, output verbatim: "The operator returns true if the value of the operand is null, false otherwise."
Me_2 is true for S and W, whose Me_1 is null, and false for B, G, M and F; Me_1 is kept.
DS_r := DS_1[ calc Me_2 := isnull(Me_1) ];
| 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 | 46818219 |
| 2012 | F | Total | Total | 5401267 |
| 2012 | W | 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 | Me_2 |
|---|---|---|---|---|---|
| 2012 | B | Total | Total | 11094850 | false |
| 2012 | G | Total | Total | 11123034 | false |
| 2012 | S | Total | Total | true | |
| 2012 | M | Total | Total | 46818219 | false |
| 2012 | F | Total | Total | 5401267 | false |
| 2012 | W | Total | Total | true |
{
"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"},
{"name": "Me_2", "type": "Boolean", "role": "Measure"}
]
}
]
}