(Demo) Fix: customer lifetime value calculation in customers#1
(Demo) Fix: customer lifetime value calculation in customers#1
Conversation
|
Should we also check customer_order_pattern? |
|
Since the sources have been updated in the production environment, I've rebased the PR, rerun the checks, and updated the body. Most of the checks yield the same results, but I noticed that 99% of the value segments are classified as 'high value' (refer to the Top-k diff above). I plan to review the threshold next week. |
eedae39 to
94036fd
Compare
94036fd to
183171a
Compare
183171a to
f35cbd1
Compare
f35cbd1 to
231f592
Compare
This comment was marked as outdated.
This comment was marked as outdated.
231f592 to
4080960
Compare
This comment was marked as outdated.
This comment was marked as outdated.
4080960 to
01a9ef1
Compare
This comment was marked as outdated.
This comment was marked as outdated.
01a9ef1 to
2ff3a39
Compare
This comment was marked as outdated.
This comment was marked as outdated.
0c99b5a to
7ca327e
Compare
e9fbba7 to
383a007
Compare
383a007 to
398ac78
Compare
398ac78 to
75a349b
Compare
75a349b to
d5fe9c4
Compare
d5fe9c4 to
73dce86
Compare
73dce86 to
4526216
Compare
4526216 to
b8709ec
Compare
083a55b to
8337818
Compare
58feedb to
5ec10dd
Compare
5ec10dd to
637a046
Compare
This comment was marked as duplicate.
This comment was marked as duplicate.
SummaryPR #1 modifies the Key Changes
Impact AnalysisLineage Analysis reveals the graph LR
stg_customers["stg_customers<br/>(view)"]:::unchanged
stg_orders["stg_orders<br/>(view)"]:::unchanged
stg_payments["stg_payments<br/>(view)"]:::unchanged
customers["customers<br/>(table)"]:::modified
customer_order_pattern["customer_order_pattern<br/>(table)"]:::impacted
customer_segments["customer_segments<br/>(table)"]:::impacted
stg_customers --> customers
stg_orders --> customers
stg_payments --> customers
customers --> customer_order_pattern
customers --> customer_segments
classDef added fill:#d4edda,stroke:#28a745,color:#000000
classDef removed fill:#f8d7da,stroke:#dc3545,color:#000000
classDef modified fill:#fff3cd,stroke:#ffc107,color:#000000
classDef impacted fill:#ffffff,stroke:#ffc107,color:#000000
classDef unchanged fill:#ffffff,stroke:#d3d3d3,color:#999999
☑️ Checklist
🔍 Suggested Actions
|

Description & motivation
The customer lifetime value (CLV) in
customersmodel incorrectly included orders that were not yet completed, leading to potentially inaccurate business insights.I modified the CLV calculation within
customersto consider only "completed" orders.To-do before merge
Notify Stakeholders
Lineage:
Lineage DAG Diff
Modified
customersmodel to adjustcustomer_lifetime_valuecalculation.Validation of models:
As expected, the customer lifetime value has changed. The average value of CLV has been reduced and this affects 98% of customers.
Query Diff:
customersThe
customer_lifetime_valuehas reduced for certain customers. This is expected given the change to the CLV calculation.Profile Diff:
customersMin/max remains unchanged, average value has dropped from 2758.6 to 1871.76 as expected.
Value Diff:
customersOnly 1.19% match on
customer_lifetime_value.Magic metric of
customersOur magic metric, average lifetime value, goes down as well.
SQL
Impact considerations:
The adjustment to CLV values has resulted in 26.45% change of customer ‘value segment’. This impact is also expected.
Value Diff:
customer_segmentscustomer_lifetime_valueas expected matches parent table at 1.19%.value_segmentis changed by 26.45%.Query Diff:
customer_segmentsvalue_segmenthas changed for some of those customers with a decreased CLV. This is expected and I'll notify the business team.Top-k diff:
value_segmentWe've seen a 17% drop in high-value customers. We need to discuss with stakeholders whether an adjustment to the threshold is necessary.
There is no change in customer_order_pattern.
Value diff:
customer_order_patternThere is no change.
Changes to existing models:
N/A
Checklist:
This checklist is mostly useful as a reminder of small things that can easily be
forgotten – it is meant as a helpful tool rather than hoops to jump through.
Put an
xin all the items that apply, make notes next to any that haven't beenaddressed, and remove any items that are not relevant to this PR.