← time_agg operator page · time/time_agg/last/end_of_the_quarter
pandas ✅ · DuckDB ✅
time_agg("Q", SC_1, last) with SC_1 = 2012-02-13: a date to its quarter, represented by its end; the page's Example 3, with the date as an input in the default YYYY-MM-DD form instead of the cast with the mask YYYYMMDD.
Time aggregation, Example 3: "The following example maps a date to quarter level, 2012 (end of the period)", DS_r := time_agg( “Q”, cast(“20120213”, date, “YYYYMMDD”), last );, "and produces a date value corresponding to the string “20120331”".
DS_r = 2012-03-31, a Date: 2012-02-13 is in the first quarter of 2012, which ends on March 31.
DS_r := time_agg("Q", SC_1, last);
| SC_1 |
|---|
| 2012-02-13 |
{
"scalars": [
{"name": "SC_1", "type": "Date"}
]
}
{
"scalars": [
{"name": "DS_r", "type": "Date", "value": "2012-03-31"}
]
}