← min operator page · aggregate/min/ds_group_by/manual_ex_1

Manual example 1 🟢 all ok

pandas ✅ · DuckDB ✅

Tests:

min at data set level grouped by Id_1, over one Integer measure.

Manual:

Minimun value, Example 1, output verbatim: "The operator returns the minimum value of the input values."

Expected:

3 for 2011, the smallest of 3, 5 and 7, and 2 for 2012, of 2 and 4; Me_1 stays Integer.

script.vtl ⇩

DS_r := min ( DS_1 group by Id_1 );

input/DS_1.csv ⇩

Id_1Id_2Id_3Me_1
2011AXX3
2011AYY5
2011BYY7
2012AXX2
2012BYY4

input/DS_1.json ⇩

{
  "datasets": [
    {
      "name": "DS_1",
      "DataStructure": [
        {"name": "Id_1", "type": "Time_Period", "role": "Identifier", "nullable": false},
        {"name": "Id_2", "type": "String", "role": "Identifier", "nullable": false},
        {"name": "Id_3", "type": "String", "role": "Identifier", "nullable": false},
        {"name": "Me_1", "type": "Integer", "role": "Measure", "nullable": true}
      ]
    }
  ]
}

expected/DS_r.csv ⇩

Id_1Me_1
20113
20122

expected/DS_r.json ⇩

{
  "datasets": [
    {
      "name": "DS_r",
      "DataStructure": [
        {"name": "Id_1", "type": "Time_Period", "role": "Identifier"},
        {"name": "Me_1", "type": "Integer", "role": "Measure"}
      ]
    }
  ]
}