Skip to content
RED SAGSkills
hard20 pts · first answer countsproduct-analyticssqlretention

A filter that breaks a left join

This query should give Day 7 retention for all January signups, but it returns 100%. Why?

SELECT COUNT(DISTINCT s.user_id) AS cohort,
       COUNT(DISTINCT a.user_id) AS retained
FROM signups s
LEFT JOIN activity a ON a.user_id = s.user_id
WHERE s.signup_month = '2026-01'
  AND a.activity_date = s.signup_date + 7;
Choose one answer

Discussion 0

Join free to post in the discussion.

Related questions