hardonline store · Q2
date functionsperiod over periodgaps

Monthly revenue growth

For every calendar month that has completed sales, show the month's revenue and its growth compared with the previous calendar month.

  • month is the first day of the month, as a date (for example 2026-01-01)
  • revenue is the sum of quantity * unit_price over completed orders, using order_ts to decide the month
  • growth_pct = 100 * (revenue - previous month revenue) / previous month revenue, rounded to 1 decimal place
  • if the previous calendar month had no completed sales (or this is the first month), growth_pct is NULL. Careful, "previous calendar month" is not the same as "previous row".
output columns
monthrevenuegrowth_pct

uses ,

ctrl + enter to run on the sample data · ctrl + shift + enter to submit

run your query to see the output here. Submit checks it against the sample data, hidden test cases, random data and a large dataset.