← and operator page · boolean/and/comp_comp/null_on_either_side

Null on either side 🟢 all ok

pandas ✅ · DuckDB ✅

Tests:

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.

Manual:

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.

Expected:

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").

script.vtl ⇩

DS_r := DS_1[calc Me_3 := Me_1 and Me_2];

input/DS_1.csv ⇩

Id_1Me_1Me_2
1false
2true
3false
4true

input/DS_1.json ⇩

{
  "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}
      ]
    }
  ]
}

expected/DS_r.csv ⇩

Id_1Me_1Me_2Me_3
1falsefalse
2true
3falsefalse
4true

expected/DS_r.json ⇩

{
  "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"}
      ]
    }
  ]
}