← time_agg operator page · time/time_agg/last/end_of_the_quarter

End of the quarter 🟢 all ok

pandas ✅ · DuckDB ✅

Tests:

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.

Manual:

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”".

Expected:

DS_r = 2012-03-31, a Date: 2012-02-13 is in the first quarter of 2012, which ends on March 31.

script.vtl ⇩

DS_r := time_agg("Q", SC_1, last);

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-03-31"}
  ]
}