← aggregate_invocation operator page · aggregate/aggregate_invocation/no_group/manual_ex_3
pandas ✅ · DuckDB ✅
avg with no grouping clause: the whole operand is one group.
Aggregate invocation, Example 3, output verbatim: "If no grouping clause is specified, then all the input Data Points are aggregated in a single group and the operator returns a Data Set that contains a single Data Point and has no Identifiers."
one data point with no identifiers: Me_1 = 155 / 10 = 15.5, a Number, and the non-viral At_1 is dropped.
DS_r := avg ( DS_1 );
| Id_1 | Id_2 | Id_3 | Me_1 | At_1 |
|---|---|---|---|---|
| 2010 | E | XX | 20 | |
| 2010 | B | XX | 1 | H |
| 2010 | R | XX | 1 | A |
| 2010 | F | YY | 23 | |
| 2011 | E | XX | 20 | P |
| 2011 | B | ZZ | 1 | N |
| 2011 | R | YY | -1 | P |
| 2011 | F | XX | 20 | Z |
| 2012 | L | ZZ | 40 | P |
| 2012 | E | YY | 30 | P |
{
"datasets": [
{
"name": "DS_1",
"DataStructure": [
{"name": "Id_1", "type": "Time_Period", "role": "Identifier", "nullable": false},
{"name": "Id_2", "type": "String", "role": "Identifier", "nullable": false},
{"name": "Id_3", "type": "String", "role": "Identifier", "nullable": false},
{"name": "Me_1", "type": "Integer", "role": "Measure", "nullable": true},
{"name": "At_1", "type": "String", "role": "Attribute", "nullable": true}
]
}
]
}
| Me_1 |
|---|
| 15.5 |
{
"datasets": [
{
"name": "DS_r",
"DataStructure": [
{"name": "Me_1", "type": "Number", "role": "Measure"}
]
}
]
}