← Back to all products

Customer Lifetime Value + Recommendations Accelerator

$2490

CLV pipeline for energy-retail/subscription customers: acquisition cost, payment behavior, forward profitability, NPV-based CLV, and renewal recommendations by value tier. Ships a dependency-free CLV library + offline tests. Fully generic, currency-neutral.

📁 18 files🏷 v1.0.0
Production-readyUnit-testedDatabricks Asset Bundle
✓ Instant download✓ Lifetime updates✓ MIT licensed✓ Secure checkout (Stripe)

⚙ Try the Live Demo interactive

Enter profit, acquisition cost, discount rate and payment behaviour and get NPV CLV, a value tier and a renewal recommendation — the shipped CLV logic.

⚡ Open CLV Calculator

📋 What's Inside 18 files

  • README.md
  • LICENSE
  • manifest.json
  • databricks.yml
  • resources/jobs.yml
  • src/01_customer_acquisition_cost.sql
  • src/02_payment_behavior_score.sql
  • src/03_estimated_profitability.sql
  • src/04_customer_lifetime_value.sql
  • src/05_renewal_recommendations.sql
  • lib/clv.py
  • tests/test_clv.py
  • conftest.py
  • guide/01_what-you-get.md
  • guide/02_getting-started.md
  • guide/03_architecture.md
  • guide/04_support.md
  • guides/clv-methodology.md

📁 File Structure 18 files

clv-recommendations-accelerator/
├── README.md
├── LICENSE
├── manifest.json
├── databricks.yml
├── resources/
│   ├── jobs.yml
├── src/
│   ├── 01_customer_acquisition_cost.sql
│   ├── 02_payment_behavior_score.sql
│   ├── 03_estimated_profitability.sql
│   ├── 04_customer_lifetime_value.sql
│   ├── 05_renewal_recommendations.sql
├── lib/
│   ├── clv.py
├── tests/
│   ├── test_clv.py
├── conftest.py
├── guide/
│   ├── 01_what-you-get.md
│   ├── 02_getting-started.md
│   ├── 03_architecture.md
│   ├── 04_support.md
├── guides/
│   ├── clv-methodology.md

📖 Documentation Preview README excerpt

Customer Lifetime Value + Recommendations Accelerator

Calculates **CLV** for energy-retail / subscription customers and generates

personalized **renewal recommendations** prioritized by value tier. A 5-step SQL

pipeline: acquisition cost → payment behavior → forward profitability → NPV-based

CLV → renewal recommendations.

Fully generic and currency-neutral: map your customer, contract, and invoice

sources and configure channel costs + discount rate.

What's inside

- **Databricks Asset Bundle** — a monthly CLV job (5 dependent SQL steps).

- **NPV CLV** — `CLV = ((profit + CAC) × (1-(1+r)^-n)/r) - CAC`, with a

configurable monthly discount rate.

- **Renewal recommendations** — High/Medium/Low/Negative tiers mapped to

retention actions, so spend goes where it pays back.

- **A dependency-free CLV library** (`lib/clv.py`): CAC, payment behavior, credit

loss, profitability, NPV CLV, tiering, and recommendations — with an offline

test suite (6 tests).

Quickstart

```bash

pip install pytest && pytest tests/ -v

databricks bundle deploy -t dev -p <profile>

```

Provide the customer model + `invoicing.f_invoice_payments`, and set

`discount_rate_monthly` and channel costs.

License

MIT — see `LICENSE`.

... preview truncated, see full README in product download.

📄 Code Sample .sql preview

src/01_customer_acquisition_cost.sql-- CLV: Customer Acquisition Cost from first-contract sales channel. -- Mirrors lib/clv.acquisition_cost(). Configure channel costs for your org. CREATE OR REPLACE TABLE IDENTIFIER(:target_catalog || '.' || :target_schema || '.calc_customer_acquisition_cost') AS WITH first_contracts AS ( SELECT customer_code, sales_channel_name, ROW_NUMBER() OVER (PARTITION BY customer_code ORDER BY start_date ASC) AS rn FROM IDENTIFIER(:source_catalog || '.customer_model.d_contract') WHERE start_date IS NOT NULL ), channel_costs AS ( SELECT * FROM VALUES ('Web self-service', 15.00), ('Website', 20.00), ('Telemarketing', 45.00), ('Customer Service', 30.00), ('Partner', 60.00), ('Door-to-door', 80.00) AS t(channel_name, cost) ) SELECT fc.customer_code, fc.sales_channel_name, COALESCE(cc.cost, 25.00) AS customer_acquisition_cost, CURRENT_TIMESTAMP() AS load_timestamp FROM first_contracts fc LEFT JOIN channel_costs cc ON fc.sales_channel_name = cc.channel_name WHERE fc.rn = 1;