Month-over-month growth

HardLAG and growth ratesSaaS / product

The problem

For each region and month, show region, month, revenue and mom_growth_pct: the percentage change from the same region's previous month, rounded to 1 decimal place.

The first month of each region has no previous month, so mom_growth_pct should be NULL. Sort by region, then month.

Tables · Product usage and revenue

Click a table or column name to insert it into your query.

  • INTEGER · primary key
  • INTEGER
  • TEXT · visit | signup | purchase
  • DATE
Sample rows (24 total)
Sample rows from app_events
event_iduser_idevent_typeevent_date
11visit2025-06-01
22visit2025-06-01
33visit2025-06-01
44visit2025-06-02
55visit2025-06-02

  • TEXT · YYYY-MM
  • TEXT
  • INTEGER · rupees
Sample rows (10 total)
Sample rows from monthly_revenue
monthregionrevenue
2025-01North100000
2025-02North110000
2025-03North105000
2025-04North120000
2025-05North130000

Next: Premium members by city →

Ctrl/⌘ + Enter runs the query. Table and column names are suggested as you type. Press Esc then Tab to leave the editor with the keyboard.

Expected output (10 rows)
Expected output
regionmonthrevenuemom_growth_pct
North2025-01100000NULL
North2025-0211000010.0
North2025-03105000-4.5
North2025-0412000014.3
North2025-051300008.3
South2025-0180000NULL
South2025-02855006.9
South2025-03900005.3
South2025-0488000-2.2
South2025-05950008.0

Row order matters for this question. Numbers are compared with a tiny tolerance; text must match exactly.

Stuck?

Stored on this device only. Your latest query and “solved” status are remembered in this browser only. They don’t sync between devices, and clearing your browser data removes them.