← time_agg operator page · time/time_agg/first/start_of_the_year
pandas ✅ · DuckDB ✅
time_agg("A", SC_1, first) with SC_1 = 2012-02-13: a date to its year, represented by its start, on the date of the page's Example 3.
Time aggregation, Example 4: "The following example maps a date to year level, 2012 (beginning of the period)" and "produces a date value corresponding to the string “20120101”". Its script, DS_r := time_agg(cast( “A”, “2012M1”, date, “YYYYMMDD”), first );, is garbled, with the indicator inside the cast and 2012M1 not matching the mask: the example writes the call that the text describes.
DS_r = 2012-01-01, a Date: with first, the year 2012 is "represented [...] by the start".
DS_r := time_agg("A", SC_1, first);
| SC_1 |
|---|
| 2012-02-13 |
{
"scalars": [
{"name": "SC_1", "type": "Date"}
]
}
{
"scalars": [
{"name": "DS_r", "type": "Date", "value": "2012-01-01"}
]
}