← aggr operator page · clause/aggr/no_group/single_group_no_identifiers
pandas ✅ · DuckDB ✅
aggr Me_1 := sum ( Me_1 ) with no grouping clause.
Aggregation: "If no grouping clause is specified, then all the input Data Points are aggregated in a single group and the clause returns a Data Set that contains a single Data Point and has no Identifiers."
One data point with no identifiers: the Measure Me_1 (no role written, and Me_1 is a Measure of DS_1) = 2 + 5 + 3 = 10. It may be Integer or Number: Sum says "implementations may preserve the integer type for the resulting measure or component when all operand values are integer and the sum is computed in integer arithmetic".
DS_r := DS_1 [ aggr Me_1 := sum ( Me_1 ) ];
| Id_1 | Id_2 | Me_1 |
|---|---|---|
| 1 | A | 2 |
| 1 | B | 5 |
| 2 | A | 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}
]
}
]
}
| Me_1 |
|---|
| 10 |
{
"datasets": [
{
"name": "DS_r",
"DataStructure": [
{"name": "Me_1", "type": ["Integer", "Number"], "role": "Measure"}
]
}
]
}