Problems / Average Customer Lifetime Spend / Editorial
orders
customers
SUM(amount) GROUP BY customer_id, signup_channel
AVG(lifetime_spend) GROUP BY signup_channel
AVG(SUM(amount))
AVG(o.amount) per channel answers a different question: the average order size. In the ads channel, one customer placed four $25 orders (spend $100) and another a single $300 order: average lifetime spend is (100 + 300) / 2 = $200, but the naive average of amounts is 400 / 5 = $80. Whenever customers place different numbers of orders, the two averages diverge — the naive one is weighted by order count, not by customer.
AVG(o.amount)
Solve Average Customer Lifetime Spend yourself →