2. Monthly Revenue Trend
Problem 1
Question
After seeing the total revenue number, Sofia is impressed but cautious.
Okay, the number is great. But are we growing? Or are we dying? Could you show me the trend over time?
Your goal is to plot the revenue history by time.
Deliverable:
- A Metabase question that shows the monthly revenue trend over time.
- Name:
Trend - Monthly Revenue - Description
- Name:
SELECT
DATE_TRUNC('month', o.order_purchase_timestamp) AS month,
SUM(op.payment_value) AS monthly_revenue
FROM orders o
JOIN order_payments op
ON o.order_id = op.order_id
WHERE o.order_status = 'delivered'
GROUP BY 1;

Problem 2
Question
It's time to learn about Data Granularity.
Materials:
https://medium.com/@adedola/data-granularity-d8ba107dd236

