← addition operator page · numeric/addition/comp_sc/manual_ex_3
pandas ✅ · DuckDB ✅
+ between a component and a Number scalar, inside calc.
Addition, Example 3, output verbatim: "The operator addition returns the sum of two numbers."
Me_3 = Me_1 + 3.0 is 8.0, 5.0, 6.0 and 7.0, a Number; the other components are kept.
DS_r := DS_1 [ calc Me_3 := Me_1 + 3.0 ];
| Id_1 | Id_2 | Me_1 | Me_2 |
|---|---|---|---|
| 10 | A | 5 | 5.0 |
| 10 | B | 2 | 10.5 |
| 11 | A | 3 | 12.2 |
| 11 | B | 4 | 20.3 |
{
"datasets": [
{
"name": "DS_1",
"DataStructure": [
{"name": "Id_1", "type": "Integer", "role": "Identifier", "nullable": false},
{"name": "Id_2", "type": "String", "role": "Identifier", "nullable": false},
{"name": "Me_1", "type": "Integer", "role": "Measure", "nullable": true},
{"name": "Me_2", "type": "Number", "role": "Measure", "nullable": true}
]
}
]
}
| Id_1 | Id_2 | Me_1 | Me_2 | Me_3 |
|---|---|---|---|---|
| 10 | A | 5 | 5.0 | 8.0 |
| 10 | B | 2 | 10.5 | 5.0 |
| 11 | A | 3 | 12.2 | 6.0 |
| 11 | B | 4 | 20.3 | 7.0 |
{
"datasets": [
{
"name": "DS_r",
"DataStructure": [
{"name": "Id_1", "type": "Integer", "role": "Identifier"},
{"name": "Id_2", "type": "String", "role": "Identifier"},
{"name": "Me_1", "type": "Integer", "role": "Measure"},
{"name": "Me_2", "type": "Number", "role": "Measure"},
{"name": "Me_3", "type": "Number", "role": "Measure"}
]
}
]
}