← subtraction operator page · numeric/subtraction/sc_comp/scalar_minuend
pandas ✅ · DuckDB ✅
a component subtracted from a scalar, so the order matters.
Subtraction: op1 is "the minuend" and op2 is "the subtrahend".
Me_3 = 10 - Me_1 is 8, 6 and 5, an Integer; the other components are kept.
DS_r := DS_1[calc Me_3 := 10 - Me_1];
| Id_1 | Me_1 | Me_2 |
|---|---|---|
| 1 | 2 | 2.5 |
| 2 | 4 | 4.0 |
| 3 | 5 | 0.5 |
{
"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}
]
}
]
}
| Id_1 | Me_1 | Me_2 | Me_3 |
|---|---|---|---|
| 1 | 2 | 2.500000 | 8 |
| 2 | 4 | 4.000000 | 6 |
| 3 | 5 | 0.500000 | 5 |
{
"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"},
{"name": "Me_3", "type": "Integer", "role": "Measure"}
]
}
]
}