← lead operator page · aggregate/lead/ds_no_offset/no_default_offset
pandas ✅ · DuckDB ✅
lead at data set level without an offset, which its syntax makes optional.
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.
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.
DS_r := lead ( DS_1 over ( partition by Id_1 order by Id_2 ) );
| Id_1 | Id_2 | Me_1 | Me_2 |
|---|---|---|---|
| A | 2020Q1 | 3 | 1.500000 |
| A | 2020Q2 | 1 | 3.500000 |
| A | 2021Q1 | 5 | 2.500000 |
| A | 2021Q2 | 1 | 0.500000 |
| B | 2020Q1 | 4 | 6.500000 |
| B | 2020Q2 | 8 | 4.500000 |
{
"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}
]
}
]
}
{"code": "0-5-1-3"}