From 7ca327eedf3eb3c75cb612f9b2f811ec37af23fc Mon Sep 17 00:00:00 2001 From: Even Wei Date: Mon, 27 Nov 2023 17:25:07 +0800 Subject: [PATCH] Correct customer lifetime value calculation in customers --- models/customers.sql | 1 + 1 file changed, 1 insertion(+) diff --git a/models/customers.sql b/models/customers.sql index 9aedd70a2..61a8302e0 100644 --- a/models/customers.sql +++ b/models/customers.sql @@ -41,6 +41,7 @@ customer_payments as ( left join orders on payments.order_id = orders.order_id + where orders.status = 'completed' group by orders.customer_id ),