Skip to content

Fix CLV metric reliability for customer segmentation - #88

Draft
ijac13 wants to merge 73 commits into
dbt-labs:duckdbfrom
DataRecce:agent-feature/financial-metrics-clv-revenue
Draft

Fix CLV metric reliability for customer segmentation#88
ijac13 wants to merge 73 commits into
dbt-labs:duckdbfrom
DataRecce:agent-feature/financial-metrics-clv-revenue

Conversation

@ijac13

@ijac13 ijac13 commented Feb 2, 2026

Copy link
Copy Markdown

Summary

Problem: "High-value" customers not converting - CLV metric unreliable for Marketing targeting.

Root causes fixed:

  • Returns inflating CLV (customers with high purchase volume but high returns counted as high-value)
  • No recency tracking (dormant customers treated same as active)
  • Static thresholds not adapting to customer base changes

Changes

  • Net CLV: Added clv_net_returns excluding return amounts from lifetime value calculation
  • Recency segments: Added days_since_last_order and recency_segment (Active/Recent/Lapsing/Dormant)
  • Marketing segments: Combined value + recency into actionable segments (VIP Active, VIP At-Risk, VIP Lost, etc.)
  • Dynamic thresholds: Replaced static $100/$50 cutoffs with percentile-based segmentation (top 25%, 25-50%, bottom 50%)

Impact

  • 57 customers reclassified based on net CLV
  • $312K in returns excluded from CLV calculations
  • New segments enable targeted campaigns for retention vs. acquisition

Reviewer Checklist (for Marketing)

  • Verify the new segment definitions match business understanding:
    • High Value = top 25% by net CLV
    • Medium Value = 25-50% by net CLV
    • Active = ordered within 30 days, Recent = 90 days, Lapsing = 180 days, Dormant = 180+ days
  • Confirm excluding returns from CLV aligns with how Marketing values customers
  • Review the marketing segments (VIP Active, VIP At-Risk, etc.) for targeting use cases
  • Run dbt build and query customer_segments to validate segment distribution

🤖 Generated with Claude Code

even-wei and others added 30 commits November 27, 2023 17:09
Signed-off-by: Even Wei <shinycockorach@gmail.com>
Signed-off-by: Wei-Chun, Chang <wcchang@infuseai.io>
…hop-data

Generate more raw jaffle shop data
Signed-off-by: Even Wei <shinycockorach@gmail.com>
…-and-segments

Add tests to customer_order_pattern and customer_segments
Signed-off-by: Even Wei <shinycockorach@gmail.com>
Signed-off-by: Kent Huang <kent@infuseai.io>
Signed-off-by: Kent Huang <kent@infuseai.io>
…ction-template-for-jaffle-shop-demo

[Feature] drc-307 prepare GitHub action template for jaffle shop demo
Signed-off-by: Wei-Chun, Chang <wcchang@infuseai.io>
[Chore] Update recce ci to use official recce
Signed-off-by: Kent Huang <kent@infuseai.io>
Signed-off-by: Kent Huang <kent@infuseai.io>
Signed-off-by: Kent Huang <kent@infuseai.io>
…preset-checks-for-demo-project

[Infra] DRC-359 Add preset checks for Recce CI
Signed-off-by: Kent Huang <kent@infuseai.io>
Signed-off-by: Kent Huang <kent@infuseai.io>
…mary-in-ci-process

[Feature] DRC-389 Setup recce ci with summary command
Signed-off-by: Kent Huang <kent@infuseai.io>
Signed-off-by: Kent Huang <kent@infuseai.io>
Signed-off-by: Kent Huang <kent@infuseai.io>
Signed-off-by: Kent Huang <kent@infuseai.io>
Signed-off-by: Kent Huang <kent@infuseai.io>
…e-the-document-of-new-command-recce-summary

[Feature] Update Recce CI workflow script
Signed-off-by: popcorny <celu@infuseai.io>
…kageyml-to-jaffle_shop_duckdb

Add packages.yml
Signed-off-by: popcorny <celu@infuseai.io>
Signed-off-by: popcorny <celu@infuseai.io>
wcchang1115 and others added 29 commits June 19, 2024 16:51
Signed-off-by: Wei-Chun, Chang <wcchang@infuseai.io>
Signed-off-by: Wei-Chun, Chang <wcchang@infuseai.io>
…le-shop-to-use-the-cloud-mode

[Chore] Update the jaffle shop to use the cloud mode
Signed-off-by: Wei-Chun, Chang <wcchang@infuseai.io>
…ckdb-file

[Chore] Move preparation task into a script
Signed-off-by: Kent Huang <kent@infuseai.io>
Signed-off-by: Kent Huang <kent@infuseai.io>
…oud-setup-flow-to-tell-users-to-setup-their

Feature/drc 521 update recce cloud setup flow to tell users to setup their
Signed-off-by: Wei-Chun, Chang <wcchang@infuseai.io>
Signed-off-by: Kent Huang <kent@infuseai.io>
…ecce

[Infra] Update devcontainer.json for recce
Signed-off-by: even-wei <evenwei@infuseai.io>
Signed-off-by: even-wei <evenwei@infuseai.io>
Signed-off-by: Wei-Chun, Chang <wcchang@infuseai.io>
Signed-off-by: Wei-Chun, Chang <wcchang@infuseai.io>
…cce-instance-from-cloud-20241023

Install dependency based on project config
- Always check is the base branch is up-to-date

Signed-off-by: Kent Huang <kent@infuseai.io>
…the-base-is-outdated

[Infra] Update GitHub Action for PR
Signed-off-by: Kent Huang <kent@infuseai.io>
Signed-off-by: Kent Huang <kent@infuseai.io>
Signed-off-by: Kent Huang <kent@infuseai.io>
Signed-off-by: Kent Huang <kent@infuseai.io>
Signed-off-by: Kent Huang <kent@infuseai.io>
Signed-off-by: popcorny <celu@infuseai.io>
…n-the-base-prep-job-every-week

Make the base update at lease per week basis
- Add clv_net_returns excluding return amounts from lifetime value
- Add days_since_last_order and recency segments (Active/Recent/Lapsing/Dormant)
- Add marketing segments combining value and recency (VIP Active, VIP At-Risk, etc.)
- Replace static value thresholds with dynamic percentile-based segmentation
- Add documentation and tests for new columns in schema.yml

Impact: 57 customers reclassified, $312K returns excluded from CLV calculations

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
@b-per

b-per commented Feb 2, 2026

Copy link
Copy Markdown
Contributor

Were you meaning to create the PR in this repo?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

6 participants