← addition operator page · numeric/addition/sc_comp/integer_plus_integer
pandas ✅ · DuckDB ✅
a scalar added to an Integer component, inside calc.
Addition: "If the type of both operands is integer then the result has type integer."
Me_3 = 3 + Me_1 is 5, 7 and 8, an Integer; the other components are kept.
DS_r := DS_1[calc Me_3 := 3 + 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 | 5 |
| 2 | 4 | 4.000000 | 7 |
| 3 | 5 | 0.500000 | 8 |
{
"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"}
]
}
]
}