← and operator page · boolean/and/comp_comp/null_on_either_side
pandas ✅ · DuckDB ✅
DS_1[calc Me_3 := Me_1 and Me_2] where every data point has a null operand, on the left for ids 1 and 4 and on the right for ids 2 and 3.
Logical conjunction: "false and null gives false", "true and null gives null" and "null and null gives null"; the page's sentence "returns true if both operands are true, otherwise false" conflicts with its null rows (true and null is null, not false), and the listed rows govern.
Me_3 is false, null, false and null for ids 1 to 4. null and false is false and null and true is null: a null on the left is not listed on the page, and follows from the three-valued logic of the User Manual ("VTL adopts 3VL").
DS_r := DS_1[calc Me_3 := Me_1 and Me_2];
| Id_1 | Me_1 | Me_2 |
|---|---|---|
| 1 | false | |
| 2 | true | |
| 3 | false | |
| 4 | true |
{
"datasets": [
{
"name": "DS_1",
"DataStructure": [
{"name": "Id_1", "type": "Integer", "role": "Identifier", "nullable": false},
{"name": "Me_1", "type": "Boolean", "role": "Measure", "nullable": true},
{"name": "Me_2", "type": "Boolean", "role": "Measure", "nullable": true}
]
}
]
}
| Id_1 | Me_1 | Me_2 | Me_3 |
|---|---|---|---|
| 1 | false | false | |
| 2 | true | ||
| 3 | false | false | |
| 4 | true |
{
"datasets": [
{
"name": "DS_r",
"DataStructure": [
{"name": "Id_1", "type": "Integer", "role": "Identifier"},
{"name": "Me_1", "type": "Boolean", "role": "Measure"},
{"name": "Me_2", "type": "Boolean", "role": "Measure"},
{"name": "Me_3", "type": "Boolean", "role": "Measure"}
]
}
]
}