From 58feedb21ddbf3c01451aa14a8e9fde4bfad42de 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 ),