82

Month-over-Month Growth

Hardwindow functionLAGgrowth calculation

Problem Description

Write a SQL query to calculate month-over-month order amount growth.

Expected Columns

  • month
  • total_amount
  • prev_month_amount
  • growth

Example Output

| month | total_amount | prev_month_amount | growth | |-------|--------------|-------------------|--------| | 2023-01 | 85350.0 | NULL | NULL | | 2023-02 | 29200.0 | 85350.0 | -65.79 | | ... | ... | ... | ... |

Hints

Unlocks after 2 more attempts
Submit your solution to unlock hints
//#82 Month-over-Month Growth
Hard

Loading schema...

Loading editor...

No results yet

Run a query to see results