← and operator page · boolean/and/sc_sc/all_four_boolean_combinations

All four boolean combinations 🟢 all ok

pandas ✅ · DuckDB ✅

Tests:

the four combinations of two boolean scalars: SC_true and SC_true, SC_true and SC_false, SC_false and SC_true and SC_false and SC_false, with SC_true = true and SC_false = false.

Manual:

Logical conjunction: "The and operator returns true if both operands are true, otherwise false."

Expected:

SC_1 is true and SC_2, SC_3 and SC_4 are false, all Booleans.

script.vtl ⇩

SC_1 := SC_true and SC_true;
SC_2 := SC_true and SC_false;
SC_3 := SC_false and SC_true;
SC_4 := SC_false and SC_false;

input/scalars.csv ⇩

SC_trueSC_false
truefalse

input/scalars.json ⇩

{
  "scalars": [
    {"name": "SC_true", "type": "Boolean"},
    {"name": "SC_false", "type": "Boolean"}
  ]
}

expected/scalars.json ⇩

{
  "scalars": [
    {"name": "SC_1", "type": "Boolean", "value": "true"},
    {"name": "SC_2", "type": "Boolean", "value": "false"},
    {"name": "SC_3", "type": "Boolean", "value": "false"},
    {"name": "SC_4", "type": "Boolean", "value": "false"}
  ]
}