← not_equal operator page · comparison/not_equal/ds_ds/manual_ex_1

Manual example 1 🟢 all ok

pandas ✅ · DuckDB ✅

Tests:

DS_1 <> DS_2: the measures of two data sets, data point by data point, with a null measure in DS_1.

Manual:

Not equal to, Example 1, output verbatim: "The operator returns false if the left is equal to right, true otherwise."

Expected:

bool_var is true for G, where 7.1 differs from 7.5, and null for R, whose measure in DS_1 is null.

script.vtl ⇩

DS_r := DS_1 <> DS_2;

input/DS_1.csv ⇩

Id_1Id_2Id_3Id_4Me_1
GTotalPercentageTotal7.1
RTotalPercentageTotal

input/DS_1.json ⇩

{
  "datasets": [
    {
      "name": "DS_1",
      "DataStructure": [
        {"name": "Id_1", "type": "String", "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": "Number", "role": "Measure", "nullable": true}
      ]
    }
  ]
}

input/DS_2.csv ⇩

Id_1Id_2Id_3Id_4Me_1
GTotalPercentageTotal7.5
RTotalPercentageTotal3

input/DS_2.json ⇩

{
  "datasets": [
    {
      "name": "DS_2",
      "DataStructure": [
        {"name": "Id_1", "type": "String", "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": "Number", "role": "Measure", "nullable": true}
      ]
    }
  ]
}

expected/DS_r.csv ⇩

Id_1Id_2Id_3Id_4bool_var
GTotalPercentageTotaltrue
RTotalPercentageTotal

expected/DS_r.json ⇩

{
  "datasets": [
    {
      "name": "DS_r",
      "DataStructure": [
        {"name": "Id_1", "type": "String", "role": "Identifier"},
        {"name": "Id_2", "type": "String", "role": "Identifier"},
        {"name": "Id_3", "type": "String", "role": "Identifier"},
        {"name": "Id_4", "type": "String", "role": "Identifier"},
        {"name": "bool_var", "type": "Boolean", "role": "Measure"}
      ]
    }
  ]
}