← floor operator page · numeric/floor/ds/one_number_measure

One number measure 🟢 all ok

pandas ✅ · DuckDB ✅

Tests:

floor on a dataset with one Number measure, which becomes an Integer measure.

Manual:

Floor gives an Integer, and in the Typical behaviours, "Operators changing the data type", the measure whose type changes is replaced: "A default generic Measure is assigned by default to the result Data Set, depending on the data type of the result", int_var for an Integer.

Expected:

int_var, an Integer: 7.2, -3.7 and 5.0 give 7, -4 and 5. The page's Example 1, on two Number measures, keeps their names.

script.vtl ⇩

DS_r := floor(DS_1);

input/DS_1.csv ⇩

Id_1Me_1
17.2
2-3.7
35.0

input/DS_1.json ⇩

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

expected/DS_r.csv ⇩

Id_1int_var
17
2-4
35

expected/DS_r.json ⇩

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