Diagnosing churn and optimizing Customer Lifetime Value (LTV) using Python & SQL.
Scenario: "FinStream" (a B2B SaaS platform) saw topline revenue growing by 20% YoY, yet cash burn was accelerating. The CFO suspected that high Customer Acquisition Costs (CAC) were masking a "leaky bucket" problem—customers were leaving before they became profitable.
My Role: I was tasked with building an automated pipeline to ingest raw subscription logs, calculate monthly "North Star" metrics, and identify exactly when and why customers were churning.
I utilized Python to group customers into "Cohorts" based on their join date. This revealed the "Month 4 Drop-off"—a critical insight that was invisible in the aggregate monthly reporting.
Figure 1: Cohort analysis showing retention rates declining significantly after Month 4 (Red zones).
Raw subscription logs were transformed into a lifecycle matrix using Pandas. Here is the core logic for the cohort indexing:
To explain revenue movement to the executive team, I built a Waterfall Bridge. This separated "Growth" into New Sales vs. Expansion, while highlighting the negative impact of Churn.
Figure 2: Monthly Recurring Revenue (MRR) bridge showing the components of growth.
Revenue growth means nothing if Churn is eating your margins. I build Unit Economics engines that reveal the truth behind the top-line numbers.
Let's Analyze Your Retention