← time_agg operator page · time/time_agg/group_all/manual_ex_1
pandas ✅ · DuckDB ✅
sum(DS_1 group all time_agg("A")): the quarters of 2010 summed by year, time_agg used with an aggregation and no operand.
Time aggregation, Example 1, its data points verbatim: "VTL also provides a component version, for use in combination with an aggregation operator, because the change of frequency requires an aggregation."
2010 with 60, 100 and 20 for A, B and C. Me_1 may be Integer or Number: Sum declares a number, but "implementations may preserve the integer type for the resulting measure or component when all operand values are integer"; the manual's output writes Integer, one of the two.
DS_r := sum ( DS_1 group all time_agg ( "A" ));
| Id_1 | Id_2 | Me_1 |
|---|---|---|
| 2010Q1 | A | 20 |
| 2010Q2 | A | 20 |
| 2010Q3 | A | 20 |
| 2010Q1 | B | 50 |
| 2010Q2 | B | 50 |
| 2010Q1 | C | 10 |
| 2010Q2 | C | 10 |
{
"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": "Me_1", "type": "Integer", "role": "Measure", "nullable": true}
]
}
]
}
| Id_1 | Id_2 | Me_1 |
|---|---|---|
| 2010 | A | 60 |
| 2010 | B | 100 |
| 2010 | C | 20 |
{
"datasets": [
{
"name": "DS_r",
"DataStructure": [
{"name": "Id_1", "type": "Time_Period", "role": "Identifier"},
{"name": "Id_2", "type": "String", "role": "Identifier"},
{"name": "Me_1", "type": ["Integer", "Number"], "role": "Measure"}
]
}
]
}