← getyear operator page · time/getyear/sc/quarterly_period

Quarterly period 🟢 all ok

pandas ✅ · DuckDB ✅

Tests:

getyear(SC_1) on a scalar time period, SC_1 = 2022Q1, the page's valid syntax getyear (2022Q1).

Manual:

Extract time period: "The operator getyear returns the year of the given date/time period."

Expected:

DS_r = 2022, an Integer: the first quarter of 2022 is in 2022.

script.vtl ⇩

DS_r := getyear(SC_1);

input/scalars.csv ⇩

SC_1
2022Q1

input/scalars.json ⇩

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

expected/scalars.json ⇩

{
  "scalars": [
    {"name": "DS_r", "type": "Integer", "value": 2022}
  ]
}