LAG & LEAD: Previous and Next Order, Gaps and Changes
This lesson is part of the course
Buy the course once for $9.99 to unlock every lesson and lab, the final exam and the certificate – lifetime access, no subscription.
Lessons in this course
- PARTITION BY vs GROUP BY: Group Totals Next to Every Row Pro
- Running Totals: Cumulative Sums per Customer, Ties & the Running Share Pro
- ROW_NUMBER, RANK & DENSE_RANK per Group: Ties and Top-n Pro
- LAG & LEAD: Previous and Next Order, Gaps and Changes Pro
- Moving Averages & Rolling Windows: Date Ranges vs Row Counts Pro
- NTILE & PERCENT_RANK: Quartiles, Percentiles and Halves per Group Pro
- FIRST_VALUE & LAST_VALUE: First Orders, Cohort Labels and the Latest Row Pro
- Capstone: Sessionisation – Gaps, New-Session Flags and Session Numbers Pro