🎯 Mục tiêu bài học
- Xây dựng Customer 360 View tích hợp dữ liệu từ nhiều nguồn
- Tính Customer Lifetime Value (CLV) cho ngân hàng
- Tạo Single Customer View report cho relationship managers
- Xác định churn risk dựa trên hành vi giao dịch
| Thông tin | Chi tiết |
|---|---|
| ⏱️ Thời lượng | 2 giờ |
| 📖 Chủ đề chính | Customer 360, CLV, Single Customer View, Churn Detection |
| 💡 Kiến thức cần có | Bài 06, 07 — Segmentation & Transaction Analysis |
| 🎯 Output | Customer 360 Dashboard & CLV Report |
📖 Thuật ngữ quan trọng
| Thuật ngữ | Tiếng Việt | Mô tả |
|---|---|---|
| Customer 360 | Hồ sơ KH toàn diện | Tích hợp mọi thông tin KH tại một nơi |
| SCV | Single Customer View | Một góc nhìn duy nhất cho mỗi KH |
| CLV | Customer Lifetime Value | Giá trị tổng cộng KH mang lại |
| Relationship Manager | Quản lý quan hệ KH | Nhân viên phụ trách KH Priority/Affluent |
| Churn Risk | Rủi ro rời bỏ | Xác suất KH ngừng sử dụng dịch vụ |
| Cross-sell Index | Chỉ số bán chéo | Số sản phẩm trung bình mỗi KH |
| Engagement Score | Điểm tương tác | Đo mức độ KH sử dụng dịch vụ |
Checkpoint
Customer 360 tích hợp: Demographics (dim_customer) + Credit History (fact_loan) + Transaction Behavior (fact_transaction) + Payment History (fact_payment). CLV ước tính giá trị dài hạn. SCV cung cấp cho RM toàn cảnh về KH trong 1 màn hình. Churn Risk phát hiện KH sắp rời bỏ.
🔄 Xây dựng Customer 360 View
Kiến trúc Customer 360
Customer 360 View — 5 Thành phần
| Metric | Mô tả |
|---|---|
| Customer Segment | Mass / Affluent / Priority |
| RFM Score + Label | Recency, Frequency, Monetary → Champion, Loyal, At Risk... |
| CLV Estimate | Giá trị khách hàng dài hạn |
| Churn Risk Score | Xác suất rời bỏ |
| Cross-sell Opportunities | Sản phẩm tiềm năng |
SQL: Customer 360 Query
1-- 1. Customer 360 — Single Customer View2WITH customer_loans AS (3 SELECT 4 customer_id,5 COUNT(*) AS total_applications,6 SUM(CASE WHEN status = 'Approved' THEN 1 ELSE 0 END) AS approved_loans,7 SUM(CASE WHEN default_flag = 1 THEN 1 ELSE 0 END) AS default_count,8 SUM(loan_amount) AS total_loan_amount,9 AVG(credit_score) AS avg_credit_score,10 AVG(dti_ratio) AS avg_dti_ratio,11 COUNT(DISTINCT product_id) AS num_products,12 MIN(application_date) AS first_loan_date,13 MAX(application_date) AS last_loan_date14 FROM fact_loan_application15 GROUP BY customer_id16),17customer_txn AS (18 SELECT 19 customer_id,20 COUNT(*) AS total_transactions,21 SUM(amount) AS total_txn_value,22 AVG(amount) AS avg_txn_value,23 AVG(balance_after) AS avg_balance,24 MAX(transaction_date) AS last_txn_date,25 DATEDIFF(DAY, MAX(transaction_date), '2024-12-31') AS days_since_last_txn,26 -- Preferred channel27 MAX(channel) AS main_channel,28 -- Monthly frequency29 COUNT(*) * 1.0 / DATEDIFF(MONTH, MIN(transaction_date), MAX(transaction_date)) AS monthly_txn_freq30 FROM fact_transaction31 GROUP BY customer_id32),33customer_payments AS (34 SELECT 35 l.customer_id,36 COUNT(p.payment_id) AS total_payments,37 ROUND(AVG(CASE WHEN p.payment_status = 'On-time' THEN 1.0 ELSE 0 END) * 100, 1) AS on_time_pct,38 ROUND(AVG(p.days_past_due), 1) AS avg_dpd,39 SUM(p.amount_due - p.amount_paid) AS total_shortfall40 FROM fact_loan_payment p41 JOIN fact_loan_application l ON p.application_id = l.application_id42 GROUP BY l.customer_id43)44SELECT 45 -- Demographics46 c.customer_id,47 c.gender,48 c.age,49 c.marital_status,50 c.education,51 c.employment_type,52 c.monthly_income,53 c.city,54 c.customer_since,55 DATEDIFF(YEAR, c.customer_since, '2024-12-31') AS tenure_years,56 -- Segment57 CASE 58 WHEN c.monthly_income >= 50000000 THEN 'Priority'59 WHEN c.monthly_income >= 20000000 THEN 'Affluent'60 ELSE 'Mass'61 END AS segment,62 -- Credit Profile63 cl.total_applications,64 cl.approved_loans,65 cl.default_count,66 cl.total_loan_amount,67 ROUND(cl.avg_credit_score, 0) AS avg_credit_score,68 ROUND(cl.avg_dti_ratio, 1) AS avg_dti_ratio,69 cl.num_products AS product_count,70 -- Transaction Behavior71 ct.total_transactions,72 ROUND(ct.avg_balance, 0) AS avg_balance,73 ROUND(ct.monthly_txn_freq, 1) AS monthly_txn_freq,74 ct.days_since_last_txn,75 -- Payment Behavior76 cp.on_time_pct,77 cp.avg_dpd,78 -- Derived: Churn Risk79 CASE 80 WHEN ct.days_since_last_txn > 90 THEN 'High Risk'81 WHEN ct.days_since_last_txn > 60 THEN 'Medium Risk'82 WHEN ct.days_since_last_txn > 30 THEN 'Low Risk'83 ELSE 'Active'84 END AS churn_risk85FROM dim_customer c86LEFT JOIN customer_loans cl ON c.customer_id = cl.customer_id87LEFT JOIN customer_txn ct ON c.customer_id = ct.customer_id88LEFT JOIN customer_payments cp ON c.customer_id = cp.customer_id;💰 Customer Lifetime Value (CLV)
CLV cho Ngân hàng
CLV ngân hàng tính dựa trên thu nhập ròng từ mỗi KH qua thời gian: lãi từ khoản vay, phí dịch vụ, trừ đi chi phí phục vụ và rủi ro default.
CLV đơn giản hóa bằng SQL
1-- 2. CLV estimation (simplified)2WITH customer_revenue AS (3 SELECT 4 c.customer_id,5 c.monthly_income,6 -- Revenue: interest from loans7 COALESCE(SUM(l.loan_amount * l.interest_rate / 100), 0) AS estimated_annual_interest,8 -- Tenure9 DATEDIFF(YEAR, c.customer_since, '2024-12-31') AS tenure_years,10 -- Risk11 COALESCE(AVG(l.default_flag), 0) AS default_probability,12 -- Products13 COUNT(DISTINCT l.product_id) AS num_products14 FROM dim_customer c15 LEFT JOIN fact_loan_application l 16 ON c.customer_id = l.customer_id AND l.status = 'Approved'17 GROUP BY c.customer_id, c.monthly_income, c.customer_since18)19SELECT 20 customer_id,21 monthly_income,22 estimated_annual_interest,23 tenure_years,24 num_products,25 ROUND(default_probability, 3) AS default_prob,26 -- Simple CLV = Annual Revenue × Expected Remaining Years × (1 - Default Prob)27 ROUND(28 estimated_annual_interest * 29 CASE WHEN tenure_years < 5 THEN 5 ELSE 3 END *30 (1 - default_probability),31 032 ) AS estimated_clv,33 -- CLV Tier34 CASE 35 WHEN estimated_annual_interest * 5 * (1 - default_probability) > 50000000 THEN 'Platinum'36 WHEN estimated_annual_interest * 5 * (1 - default_probability) > 20000000 THEN 'Gold'37 WHEN estimated_annual_interest * 5 * (1 - default_probability) > 5000000 THEN 'Silver'38 ELSE 'Bronze'39 END AS clv_tier40FROM customer_revenue41ORDER BY estimated_clv DESC;CLV Distribution
1-- 3. CLV summary theo segment2WITH clv_data AS (3 SELECT 4 c.customer_id,5 CASE 6 WHEN c.monthly_income >= 50000000 THEN 'Priority'7 WHEN c.monthly_income >= 20000000 THEN 'Affluent'8 ELSE 'Mass'9 END AS segment,10 COALESCE(SUM(l.loan_amount * l.interest_rate / 100) * 5 * 11 (1 - AVG(l.default_flag)), 0) AS clv12 FROM dim_customer c13 LEFT JOIN fact_loan_application l 14 ON c.customer_id = l.customer_id AND l.status = 'Approved'15 GROUP BY c.customer_id, c.monthly_income16)17SELECT 18 segment,19 COUNT(*) AS customers,20 ROUND(AVG(clv), 0) AS avg_clv,21 ROUND(SUM(clv), 0) AS total_clv,22 ROUND(SUM(clv) * 100.0 / SUM(SUM(clv)) OVER(), 1) AS pct_total_clv23FROM clv_data24GROUP BY segment25ORDER BY avg_clv DESC;Thông thường, 20% khách hàng (Priority + Affluent) đóng góp 80% lợi nhuận. CLV analysis giúp ngân hàng tập trung nguồn lực vào nhóm KH giá trị cao và tối ưu chi phí phục vụ nhóm Mass.
Checkpoint
Customer 360 tích hợp 4 nguồn: Demographics + Credit + Transaction + Payment → tạo Single Customer View cho RM. CLV trong banking = Annual Interest Revenue × Expected Years × (1 - Default Prob). 80/20 rule: 20% KH tạo 80% lợi nhuận. Churn Risk dựa trên days_since_last_txn (>90 ngày = High Risk).
📋 Tổng kết
Kiến thức đã học
| Chủ đề | Nội dung chính |
|---|---|
| Single Customer View | Tích hợp Demographics + Credit + Transaction + Payment |
| CLV Calculation | Annual Revenue × Lifespan × (1 - Default Prob) |
| 80/20 Rule | 20% KH Priority tạo 80% lợi nhuận |
| Churn Risk | Days since last transaction > 90 ngày = High Risk |
| RM Dashboard | Single view cho Relationship Manager |
Key Takeaways
- ✅ Customer 360 tích hợp tất cả dữ liệu KH vào 1 view duy nhất
- ✅ CLV giúp ngân hàng tập trung nguồn lực vào KH giá trị cao
- ✅ Churn prediction sớm giúp retention campaign hiệu quả hơn
- ✅ 80/20 rule — Priority segment cần chăm sóc đặc biệt
Câu hỏi tự kiểm tra
- Customer 360 tích hợp những nguồn dữ liệu nào?
- CLV trong banking được tính như thế nào?
- Tại sao 80/20 rule quan trọng trong banking?
- Churn Risk được đo bằng chỉ số nào?
Bài tiếp theo: Banking Dashboard Design →
🎉 Tuyệt vời! Bạn đã thành thạo Customer 360 View!
Nhớ: Customer 360 = tất cả về 1 KH trên 1 màn hình. CLV + Churn Risk = ưu tiên phục vụ và giữ chân KH!
