← time_agg operator page · time/time_agg/first/start_of_the_year

Start of the year 🟢 all ok

pandas ✅ · DuckDB ✅

Tests:

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.

Manual:

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.

Expected:

DS_r = 2012-01-01, a Date: with first, the year 2012 is "represented [...] by the start".

script.vtl ⇩

DS_r := time_agg("A", SC_1, first);

input/scalars.csv ⇩

SC_1
2012-02-13

input/scalars.json ⇩

{
  "scalars": [
    {"name": "SC_1", "type": "Date"}
  ]
}

expected/scalars.json ⇩

{
  "scalars": [
    {"name": "DS_r", "type": "Date", "value": "2012-01-01"}
  ]
}