From 183171ac3af14dae6f7a1fed20155a2db30db887 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 016a004fe..6972e9a14 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 ),