← greater operator page · comparison/greater/ds_ds/manual_ex_3

Manual example 3 🟢 all ok

pandas ✅ · DuckDB ✅

Tests:

DS_2 > DS_3: the measures of two data sets, data point by data point.

Manual:

Greater than, Example 3, output verbatim: "The operator > returns true if left is greater than right, false otherwise." The page adds that "if the Me_1 column for Germany in the DS_2 or DS_3 Data Set had a null value the result would be null for Germany (G)".

Expected:

bool_var is false for G (7.1 against 7.5) and true for R (42.5 against 33.7).

script.vtl ⇩

DS_r:= DS_2 > DS_3;

input/DS_2.csv ⇩

Id_1Id_2Id_3Id_4Me_1
GTotalPercentageTotal7.1
RTotalPercentageTotal42.5

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

input/DS_3.csv ⇩

Id_1Id_2Id_3Id_4Me_1
GTotalPercentageTotal7.5
RTotalPercentageTotal33.7

input/DS_3.json ⇩

{
  "datasets": [
    {
      "name": "DS_3",
      "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
GTotalPercentageTotalfalse
RTotalPercentageTotaltrue

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