workOwonworkOwonA New Way to Connect
HomeFeedJobsCommunitiesEventsFeaturesAbout workOwon
HomeFeedJobsCommunitiesEventsFeaturesAbout workOwon
HomeCommunitiesData Engineering Guild

Calculating 7-day rolling bookings per city. Using ROWS BETWEEN 6 PRECEDING AND CURRENT ROW but I get weird…

AV

Anika Verma

Data Analyst | SQL, Power BI, Python | Turning messy data into decisions

4 Oct 2026· Data Engineering Guild

Calculating 7-day rolling bookings per city. Using ROWS BETWEEN 6 PRECEDING AND CURRENT ROW but I get weird results on days with no bookings. Should I use RANGE?
4 reactions3 comments

Comments

  • RI

    Reyansh Iyer4 Oct 2026

    ROWS counts rows, not days, so missing days break it. Either generate a date spine and left join (my preference), or use RANGE with an interval if your warehouse supports it.

  • PB

    Priya Banerjee4 Oct 2026

    Date spine + left join, every time. It also makes the zeros show up in charts.

  • AV

    Anika Verma5 Oct 2026

    Date spine it is. Thank you!

Join the conversation

Join workOwon to react, comment and follow people and communities you care about.

Log inJoin now

Popular communities

See all