← subtraction operator page · numeric/subtraction/sc_ds/scalar_minuend

Scalar minuend 🟢 all ok

pandas ✅ · DuckDB ✅

Tests:

every measure of a dataset subtracted from a scalar, so the order matters.

Manual:

Subtraction: op1 is "the minuend" and op2 is "the subtrahend".

Expected:

10 - DS_1: Me_1 (Integer) 8, 6 and 5; Me_2 (Number) 7.5, 6.0 and 9.5.

script.vtl ⇩

DS_r := 10 - DS_1;

input/DS_1.csv ⇩

Id_1Me_1Me_2
122.5
244.0
350.5

input/DS_1.json ⇩

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

expected/DS_r.csv ⇩

Id_1Me_1Me_2
187.500000
266.000000
359.500000

expected/DS_r.json ⇩

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