← lead operator page · aggregate/lead/ds_no_offset/no_default_offset

No default offset 🟢 all ok

pandas ✅ · DuckDB ✅

Tests:

lead at data set level without an offset, which its syntax makes optional.

Manual:

Lead: "the operator returns the value(s) taken from the Data Point at the specified physical offset beyond the current Data Point"; the page does not say which offset applies when it is omitted.

Expected:

the error 0-5-1-3, "{op} requires an offset parameter": with no offset there is no "specified physical offset", and the page gives no default.

script.vtl ⇩

DS_r := lead ( DS_1 over ( partition by Id_1 order by Id_2 ) );

input/DS_1.csv ⇩

Id_1Id_2Me_1Me_2
A2020Q131.500000
A2020Q213.500000
A2021Q152.500000
A2021Q210.500000
B2020Q146.500000
B2020Q284.500000

input/DS_1.json ⇩

{
  "datasets": [
    {
      "name": "DS_1",
      "DataStructure": [
        {"name": "Id_1", "type": "String", "role": "Identifier", "nullable": false},
        {"name": "Id_2", "type": "Time_Period", "role": "Identifier", "nullable": false},
        {"name": "Me_1", "type": "Number", "role": "Measure", "nullable": true},
        {"name": "Me_2", "type": "Number", "role": "Measure", "nullable": true}
      ]
    }
  ]
}

expected/error.json ⇩

{"code": "0-5-1-3"}