Interactive analytics dashboard for calculating, segmenting, and visualizing Customer Lifetime Value from transactional data — built to support data-driven retention and marketing decisions.
Live Demo: https://dashboardclv.streamlit.app/
Raw transactional data tells you what customers bought — but not which customers are worth retaining, which are at risk of churning, or how much revenue each segment will generate over time. Without Customer Lifetime Value analysis, marketing budgets are spent equally on high-value and low-value customers, leading to poor ROI.
This dashboard processes customer transaction data, computes CLV metrics, segments customers by value, and presents insights through interactive visualizations — giving businesses a clear view of where their long-term revenue is coming from.
| Feature | Description |
|---|---|
| CLV Calculation | Computes customer-wise lifetime value from transaction history |
| Customer Segmentation | Groups customers into value-based segments |
| Interactive Charts | Plotly-powered visualizations for CLV distribution and trends |
| Segment-wise Analysis | Compares revenue contribution across customer segments |
| KPI Overview | Key metrics — total CLV, average CLV, top customer value |
| Optimized Data Storage | Processed data stored in Parquet format for fast loading |
CLV Dashboard/
│
├── app.py # Main Streamlit dashboard
│
├── data/ # Raw CSV datasets
│ ├── dataset1.csv
│ └── dataset2.csv
│
├── processed_data/ # Cleaned and optimized datasets
│ ├── customer_wise.parquet # Per-customer CLV metrics
│ └── segment_wise.parquet # Segment-level aggregations
│
├── CLV_Analysis.ipynb # Exploratory analysis and CLV computation
├── .streamlit/
│ └── config.toml # UI theme configuration
└── requirements.txt
Raw Data Processing Output
──────── ────────── ──────
CSV Transactions → Data Cleaning → Clean DataFrame
Clean Data → CLV Formula Applied → Customer CLV Scores
CLV Scores → Segmentation Logic → Customer Segments
Segments → Aggregation → Segment Metrics
All Metrics → Plotly Visualizations → Interactive Dashboard
Customer Lifetime Value is calculated using historical transaction data:
CLV = Average Order Value × Purchase Frequency × Customer Lifespan
Customers are then segmented based on their CLV score into tiers — enabling businesses to prioritize retention efforts on high-value customers and identify growth opportunities in mid-tier segments.
- Python 3.8 or above
# Clone the repository
cd clv-dashboard
# Install dependencies
pip install -r requirements.txt
# Run the dashboard
streamlit run app.pyThe app will open at http://localhost:8501
Or visit the live deployment at https://dashboardclv.streamlit.app/
| Layer | Technology |
|---|---|
| Dashboard | Streamlit |
| Visualizations | Plotly, Matplotlib, Seaborn |
| Data Processing | Pandas, PyArrow |
| Analysis | Jupyter Notebook |
| Data Storage | Parquet (via PyArrow) |
Why Parquet instead of CSV for processed data? CSV files reload and reparse on every dashboard interaction. Parquet is a columnar binary format — it loads 5-10x faster and uses significantly less memory, which matters when the dashboard is processing thousands of customer records on each filter or segment change.
Why segment by CLV instead of RFM? RFM (Recency, Frequency, Monetary) segments customers by behavioral dimensions separately. CLV combines all three into a single forward-looking value score — making it more directly actionable for budget allocation and retention prioritization decisions.
- Add predictive CLV using BG/NBD model for future value forecasting
- Integrate churn probability scoring per customer segment
- Add cohort analysis to track CLV trends over time
- Export segment reports as CSV or PDF
MIT License — free to use, modify, and distribute.