Smooth daily revenue with a 3-day rolling average
Marketing smooths daily revenue noise with a three-day moving average — weekends and one-off spikes stop yanking the trend, and the long-term signal becomes clearer. For every day compute the average revenue over that day and the two previous ones, rounding the result to two decimal places. Sort by day.
Expected output sample
This is what a correct answer looks like — its row count is its own, it doesn't have to match the schema tables.
| d | avg_3d |
|---|---|
| 2024-01-01 | 100.00 |
| 2024-01-02 | 110.00 |
| 2024-01-03 | 110.00 |
Sign in to see submission history
Sign inSign in to use AI Mentor
Sign in