Judie Alvarez
ResourcesThoughtsCase StudiesLet's talk
SaaS Analytics - SQL queries for retention diagnosisSaaS Analytics - SQL queries for retention diagnosis

The 3 Analytics Mistakes Killing Your SaaS (And the SQL Queries to Fix Them)

12 min read
December 30, 2025
Judie Alvarez

On this page

  • What is Cohort Analysis?
  • Mistake #1: The 'Average Churn' Trap
  • Mistake #2: The 'Signup' Trap
  • Mistake #3: The 'Gross vs. Net' Trap
  • Bonus: The Early Warning Query
  • What These Queries Will Show You
  • The Uncomfortable Truth
  • When the Data Looks Bad
CAC Payback Calculator
CAC Payback Calculator

Know your real CAC payback across blended, paid, and organic channels.

Get the Calculator
Back to ThoughtsSaaS Analytics

Your dashboard is lying to you.

Right now, you're probably looking at "Average Churn" or "Total Signups" and feeling okay about the numbers. Maybe even good. The lines are going up. The percentages look reasonable.

But these are vanity metrics. They hide the truth. And the truth is what kills companies.

Average churn mixes your loyal two-year customers with your brand-new signups who left after a week. Total signups counts database entries, not users. Your dashboard shows you a blended reality that obscures where you're actually bleeding.

The fix isn't better dashboards. It's going to the database. Running the queries yourself. Seeing the raw numbers that your analytics tools smooth over.

This article gives you three SQL queries that will show you what's actually happening in your SaaS. They're not complicated. But the insights might be uncomfortable.

Disclaimer: This article is written for founders who want to understand their business at the database level. If you don't write SQL, skim the queries and focus on the interpretation—the insights apply either way.

What is Cohort Analysis?

Cohort analysis is a method of tracking the behavior of a specific group of users (a "cohort") over time, rather than looking at all users at once. It is the only accurate way to measure product-market fit and retention health. Instead of asking "what's our churn rate?", cohort analysis asks "what's the churn rate for users who signed up in January versus users who signed up in March?"

Vanity metrics visualization - signups hiding real problems

Mistake #1: The "Average Churn" Trap

Here's how most founders calculate churn:

Total Churned Users ÷ Total Users = Churn Rate

Simple. Clean. Completely misleading.

The problem: if you have 1,000 loyal users who've been with you for two years and 100 new users who all leave in the first month, your average churn looks fine. Maybe 10%. Investors won't panic. Your board won't ask hard questions.

But your new user churn is 100%. You have a catastrophically leaky bucket, and the average is hiding it.

This is why SaaS companies die with "healthy" metrics. The aggregate number looks acceptable while the underlying cohort data screams that something is broken.

The latest benchmarks show the first three months are critical. Churn rates typically run around 10% in Month 1, declining to 4% by Month 3. If your new cohorts are churning faster than this, you have an onboarding problem. If they're churning at these rates but your average looks low, your old cohorts are masking the decay.

The Fix: Weekly Cohort Retention

Stop looking at averages. Start looking at cohorts.

This query shows you retention by signup week. You'll see exactly which cohorts are healthy and which are bleeding out:

QUERY 1: Weekly Retention by Cohort (PostgreSQL)
SELECT
  DATE_TRUNC('week', u.created_at) AS cohort_week,
  COUNT(DISTINCT u.id) AS cohort_size,
  COUNT(DISTINCT CASE 
    WHEN e.created_at BETWEEN u.created_at 
      AND u.created_at + INTERVAL '7 days' 
    THEN u.id END) AS week_1_active,
  COUNT(DISTINCT CASE 
    WHEN e.created_at BETWEEN u.created_at + INTERVAL '21 days' 
      AND u.created_at + INTERVAL '28 days' 
    THEN u.id END) AS week_4_active,
  ROUND(
    COUNT(DISTINCT CASE 
      WHEN e.created_at BETWEEN u.created_at + INTERVAL '21 days' 
        AND u.created_at + INTERVAL '28 days' 
      THEN u.id END)::numeric / 
    NULLIF(COUNT(DISTINCT u.id), 0) * 100, 1
  ) AS week_4_retention_pct
FROM users u
LEFT JOIN events e ON u.id = e.user_id
WHERE u.created_at >= NOW() - INTERVAL '12 weeks'
GROUP BY 1
ORDER BY 1 DESC;

Note: These queries are written for PostgreSQL, the standard for most modern SaaS stacks. If you use MySQL, swap DATE_TRUNC for DATE_FORMAT and INTERVAL syntax accordingly.

What you're looking for:

A healthy SaaS shows improving retention over time as you refine onboarding. If recent cohorts retain worse than older ones, something broke. If all cohorts drop off sharply after week 1, your activation is failing.

The data from 2024 shows median early-stage companies (under $300K ARR) have customer churn rates around 6.5% monthly. As companies mature and find product-market fit, this drops to 3.1% for companies over $8M ARR. Compare your cohort retention to these benchmarks.

Retention Health Scorecard

Run the queries. Input your numbers. Get an instant diagnosis against 2026 benchmarks.

Get the Scorecard

No-Code Alternative: Mixpanel, Amplitude, and ChartMogul all generate cohort retention charts. If you don't have direct database access, these tools can show you the same data. But running the query yourself forces you to understand what the numbers actually mean.

Mistake #2: The "Signup" Trap

"We got 1,000 signups last month!"

Congratulations. You added 1,000 rows to your users table. That's not growth. That's server cost.

A signup is a database entry. It means someone filled out a form. It doesn't mean they understood your product. It doesn't mean they got value. It doesn't mean they'll ever come back.

The metric that matters is activation. How many of those signups actually did the thing that makes your product valuable?

For a project management tool, activation might be "created a project and added a task." For an email platform, it might be "sent first campaign." For analytics software, it might be "connected a data source."

If users don't reach that activation point, they're not users. They're ghosts.

System analytics - measuring activation

The latest benchmarks from Userpilot's 2024 report across 547 SaaS companies show average activation rate is 36-37.5%, with a median of 30%. The 60th percentile is considered good. The 80th percentile is great.

Average time-to-value across SaaS is 1 day, 12 hours, and 23 minutes. If your users aren't activating in the first 24-48 hours, you likely have an onboarding problem, not a product problem.

The Fix: Time-to-First-Value (TTFV)

This query shows you how many signups actually performed your core action within 24 hours:

QUERY 2: Activation Rate (24-hour Time-to-First-Value)
SELECT
  DATE_TRUNC('day', u.created_at) AS signup_date,
  COUNT(DISTINCT u.id) AS total_signups,
  COUNT(DISTINCT e.user_id) AS activated_users,
  ROUND(
    COUNT(DISTINCT e.user_id)::numeric / 
    NULLIF(COUNT(DISTINCT u.id), 0) * 100, 1
  ) AS activation_rate_pct,
  ROUND(
    AVG(EXTRACT(EPOCH FROM (e.created_at - u.created_at)) / 3600), 1
  ) AS avg_hours_to_activate
FROM users u
LEFT JOIN events e
  ON u.id = e.user_id
  AND e.event_name = 'CORE_ACTION'  -- Replace with your activation event
  AND e.created_at <= u.created_at + INTERVAL '24 hours'
WHERE u.created_at >= NOW() - INTERVAL '30 days'
GROUP BY 1
ORDER BY 1 DESC;

Note: Make sure to replace 'CORE_ACTION' in the query with your specific event name (e.g., 'project_created' or 'email_sent').

What you're looking for:

If your activation rate is below 30%, you're losing most of your signups before they ever experience value. That's not a retention problem. That's an onboarding problem.

FairMarkit found that a 25% increase in activation leads to a 34% rise in revenue. Activation is the highest-leverage metric in your entire funnel.

Compare your activation rate day-over-day. Did a product change improve it? Did a new marketing channel bring lower-intent users? The daily view shows you cause and effect.

No-Code Alternative: Most product analytics tools (Amplitude, Mixpanel, Heap, PostHog) can track activation events and show conversion funnels. Set up your activation event as a goal and track the conversion rate from signup to activation.

Mistake #3: The "Gross vs. Net" Trap

You're tracking customers lost. Good.

But are you tracking revenue lost?

Here's the problem: logo retention hides revenue churn. You might keep a customer, but if they downgrade from your $500/month plan to your $50/month plan, you've lost 90% of that revenue while retaining 100% of that logo.

ChartMogul illustrates this perfectly: imagine three customers paying $20, $30, and $50 per month. If the $50 customer churns, your customer churn is 33% (one of three left). But your revenue churn is 50% (you lost half your MRR).

This is why sophisticated investors look at Net Revenue Retention (NRR), not just logo retention. NRR accounts for expansion (upsells, cross-sells, price increases) and contraction (downgrades, partial churn). Expansion revenue is the only free growth you get. It has $0 CAC. That is why 110% NRR is the holy grail—it means you grow 10% next year even if marketing shuts down completely.

The 2025 benchmarks are clear:

SegmentGood NRRGreat NRRProblem Zone
SMB90-105%105%+Below 90%
Mid-Market105-115%115%+Below 100%
Enterprise115-125%125%+Below 110%

Companies with high NRR grow 2.5x faster than their low-NRR counterparts, according to High Alpha's 2024 SaaS Benchmarks Report. That's because NRR compounds. If your NRR is 110%, you grow 10% annually from existing customers alone, before you close a single new deal.

Median NRR across B2B SaaS in 2025 is 106%. Median Gross Revenue Retention (which excludes expansion) is 90%, with top quartile at 95%+.

Compare Your Metrics to 2026 Benchmarks

The Retention Health Scorecard diagnoses cohort retention, activation, churn, NRR, and GRR. Input 5 numbers, get a color-coded diagnosis.

Get the Scorecard

The Fix: Net Revenue Retention by Cohort

This query calculates NRR for each monthly cohort, showing you which cohorts expand and which contract:

QUERY 3: Net Revenue Retention by Monthly Cohort
WITH cohort_mrr AS (
  SELECT
    DATE_TRUNC('month', u.created_at) AS cohort_month,
    u.id AS user_id,
    -- MRR at end of first full month
    COALESCE(SUM(CASE 
      WHEN s.period_start <= DATE_TRUNC('month', u.created_at) + INTERVAL '1 month'
      AND (s.period_end IS NULL OR s.period_end > DATE_TRUNC('month', u.created_at) + INTERVAL '1 month')
      THEN s.mrr END), 0) AS initial_mrr,
    -- MRR at end of month 12
    COALESCE(SUM(CASE 
      WHEN s.period_start <= DATE_TRUNC('month', u.created_at) + INTERVAL '12 months'
      AND (s.period_end IS NULL OR s.period_end > DATE_TRUNC('month', u.created_at) + INTERVAL '12 months')
      THEN s.mrr END), 0) AS month_12_mrr
  FROM users u
  LEFT JOIN subscriptions s ON u.id = s.user_id
  WHERE u.created_at >= NOW() - INTERVAL '24 months'
  GROUP BY 1, 2
)
SELECT
  cohort_month,
  COUNT(DISTINCT user_id) AS cohort_size,
  SUM(initial_mrr) AS starting_mrr,
  SUM(month_12_mrr) AS ending_mrr,
  ROUND(
    SUM(month_12_mrr)::numeric / 
    NULLIF(SUM(initial_mrr), 0) * 100, 1
  ) AS nrr_pct
FROM cohort_mrr
WHERE initial_mrr > 0
GROUP BY 1
ORDER BY 1 DESC;

What you're looking for:

NRR above 100% means your existing customers are worth more over time. You can grow without acquiring anyone new. This is the foundation of capital-efficient growth, which matters a lot more now that CAC has increased 222% over the past eight years.

If your NRR is below 100%, you're on a treadmill. Every churned or contracted dollar must be replaced by new sales just to stay flat. And as I covered in the CAC Payback article, new customer acquisition is getting more expensive every year.

NRR below 90% is a red flag. Either your product isn't delivering ongoing value, your pricing doesn't scale with usage, or you're attracting the wrong customers.

No-Code Alternative: ChartMogul, Baremetrics, and ProfitWell (now Paddle Retain) all calculate NRR automatically if you connect your billing system. They'll show you cohort-level revenue retention charts without writing SQL.

Bonus: The Early Warning Query

Here's one more query that ties everything together. It identifies users who are showing pre-churn signals so you can intervene before they leave:

QUERY 4: Churn Risk Identification
WITH user_activity AS (
  SELECT
    u.id AS user_id,
    u.email,
    u.created_at AS signup_date,
    s.mrr AS current_mrr,
    MAX(e.created_at) AS last_active_date,
    COUNT(DISTINCT DATE_TRUNC('day', e.created_at)) AS active_days_last_30,
    EXTRACT(DAY FROM NOW() - MAX(e.created_at)) AS days_since_last_active
  FROM users u
  LEFT JOIN events e 
    ON u.id = e.user_id 
    AND e.created_at >= NOW() - INTERVAL '30 days'
  LEFT JOIN subscriptions s 
    ON u.id = s.user_id 
    AND s.status = 'active'
  WHERE s.mrr > 0
  GROUP BY 1, 2, 3, 4
)
SELECT
  user_id,
  email,
  current_mrr,
  days_since_last_active,
  active_days_last_30,
  CASE
    WHEN days_since_last_active > 14 THEN 'HIGH RISK'
    WHEN days_since_last_active > 7 THEN 'MEDIUM RISK'
    WHEN active_days_last_30 < 3 THEN 'LOW ENGAGEMENT'
    ELSE 'HEALTHY'
  END AS churn_risk
FROM user_activity
WHERE days_since_last_active > 7 OR active_days_last_30 < 3
ORDER BY current_mrr DESC, days_since_last_active DESC;

This surfaces your highest-MRR customers who are showing disengagement signals. A customer who hasn't logged in for two weeks is telling you something. Listen before they churn.

What These Queries Will Show You

Run these four queries and you'll know:

  • From Query 1 (Cohort Retention):Are your recent cohorts healthier or sicker than older ones? Is your product getting stickier or leakier over time?
  • From Query 2 (Activation Rate):How many signups actually become users? Where in the first 24 hours are you losing them?
  • From Query 3 (NRR by Cohort):Are your customers worth more or less over time? Which cohorts expand and which contract?
  • From Query 4 (Churn Risk):Which paying customers are about to leave? Who should your customer success team call today?

These aren't vanity metrics. They're the diagnostics that tell you whether your business is healthy or slowly dying while the dashboard says everything is fine.

Get the Diagnosis in 30 Seconds

You have the numbers. Now compare them to 2026 benchmarks and know exactly where to focus.

Get the Scorecard

The Uncomfortable Truth

Most founders avoid this level of analysis because the numbers might be bad.

That's exactly why you need to do it.

The companies that win are the ones that see the leaky bucket early and fix it. The ones that lose are the ones who trusted the dashboard until the cash ran out.

Your "healthy" average churn might be hiding 100% new-user churn. Your "great" signup numbers might be 70% ghosts who never activated. Your "stable" logo retention might be masking 40% revenue contraction.

The queries in this article will tell you the truth. What you do with it is up to you.

When the Data Looks Bad

If you run these queries and the numbers are ugly, that's not failure. That's diagnosis.

The 90-Day GTM Framework walks through how to systematically identify and fix leaky buckets. The CAC Payback Calculator helps you understand whether your acquisition economics can survive your current retention rates.

And if you want help interpreting what these queries show you and building a plan to fix it, that's what I do.

These queries tell you what is broken. Fixing it requires pricing, onboarding, channel, and activation decisions—which is the work I do with Seed–Series A teams.

Judie Alvarez

About Judie Alvarez

Judie Alvarez is a fractional CMO who diagnoses SaaS growth problems at the database level. She's helped Seed to Series A startups identify retention leaks, fix activation failures, and build the analytics infrastructure that reveals what dashboards hide.

Learn more →

Ready to fix your retention?

Book a 20-minute strategy call to discuss what your data is telling you and build a plan to fix it.

Book a Strategy Call →

Related Articles

How to Cut CAC by 60% Without Paid Ads
Distribution Strategy

How to Cut CAC by 60% Without Paid Ads

December 27, 2025
15 min read
CAC Payback vs. LTV: The Real 2026 Benchmarks for Seed to Series A
Unit Economics

CAC Payback vs. LTV: The Real 2026 Benchmarks for Seed to Series A

December 17, 2025
14 min read
The B2B SaaS Growth Operating System: A 90-Day GTM Framework (With Templates)
Growth Strategy

The B2B SaaS Growth Operating System: A 90-Day GTM Framework (With Templates)

December 15, 2025
18 min read
Judie Alvarez

Navigation

ResourcesCase StudiesThoughts

Legal

Terms & ConditionsPrivacy PolicyCookie Policy

Stay Updated

Get monthly insights on distribution, fundraising, and startup growth.

© 2026 Judie Alvarez. All rights reserved.