Smoothed revenue 'Clothing', α = 0.8, no cancelled
Instructions
The monthly revenue is the sum of quantity * price (order_items.price) over the items of products in the category 'Clothing' (category_id = 3) in orders of all statuses except 'cancelled' created in that month (by created_at); every month of 2025 has such revenue. Compute the exponentially smoothed revenue smoothed with coefficient α = 0.8: for January 2025 smoothed = revenue, for each following month smoothed = 0.8 * the month's revenue + 0.2 * the previous month's smoothed. Output month (the first day of the month, type date), revenue and smoothed rounded to 2 decimal places (do not round intermediate values). The months are January to December 2025; sort by month ascending.
Hints
Each next one is more detailed and costs more
Query
Result
Click Run to see the query result, or Check to submit your solution.
Dataset schema
Table relationships
- N:1Many-to-one
order_items.→order_id orders.id - N:1Many-to-one
order_items.→product_id products.id - N:1Many-to-one
orders.→customer_id customers.id - N:1Many-to-one
products.→category_id categories.id
Table data
Select a table in the diagram or list to view its rows.