A cohort-analysis dashboard visualizes how groups of users that share a starting event behave over time, revealing retention and engagement patterns.
A cohort-analysis dashboard groups users by a common starting point—such as sign-up month or first purchase—and tracks their behavior across subsequent time periods so you can measure retention, engagement, and monetization.
Raw user counts rarely tell the whole story. A product that acquires thousands of new users every month may still be unhealthy if those users churn shortly after signing up. Cohort analysis isolates retention and engagement by start date, letting you:
The rule that places a user into a cohort—typically the date of the first key event (sign-up, first order, or first session). A robust dashboard allows you to change this definition easily.
Most dashboards track retention (whether a user returns) or monetization (spend per user) at regular intervals. Other metrics include product engagement (e.g., messages sent) or onboarding completion.
Common buckets are days, weeks, or months since the cohort’s start event. Weekly buckets (Week 0, Week 1, …) strike a balance between granularity and interpretability for SaaS products.
The classic output is a heat map where rows are cohorts and columns are time buckets, color-coded by retention percentage. Modern BI tools can also show line charts, cumulative curves, and funnel views.
You need a users
table with user_id
and first_activity_date
, and an events
table with at least user_id
, event_date
, and event type or revenue fields. Normalize timestamps to UTC and make sure your warehouse partitions large event tables by date for performance.
The goal is to compute, for every cohort and every bucket, the number of users who performed the target action. Below is a canonical pattern that works in Snowflake, BigQuery, Redshift, and Postgres.
WITH user_cohorts AS (
SELECT
u.user_id,
DATE_TRUNC('week', u.first_activity_date) AS cohort_week
FROM users u
),
activity AS (
SELECT
e.user_id,
DATE_TRUNC('week', u.first_activity_date) AS cohort_week,
DATE_DIFF('week', u.first_activity_date, e.event_date) AS weeks_since_signup
FROM events e
JOIN users u USING (user_id)
WHERE e.event_date >= u.first_activity_date
)
SELECT
cohort_week,
weeks_since_signup AS bucket,
COUNT(DISTINCT user_id) AS active_users
FROM activity
GROUP BY 1, 2;
This produces a fact table you can feed directly into a BI heat map. Pivoting in SQL is optional—most tools can handle grouping and color mapping.
Upload or connect the SQL result to your visualization layer (Tableau, Metabase, Looker, or the upcoming Galaxy lightweight viz). Configure:
cohort_week
bucket
active_users / first_week_users
(retention %)Add slicers for product line, geography, marketing channel, and device type to enable deeper analysis.
Schedule the query to run daily and refresh your dashboard. In Airflow or dbt, materialize the cohort_retention
table with an incremental strategy to avoid scanning historical data.
Counting a user as active in Week 0 and Week 1 when the first and second actions occur within 48 hours inflates retention. Solve this by truncating both cohort start and event dates to the same grain before diffing.
When a user signs up, churns, and later re-signs, they may appear in multiple cohorts. Deduplicate by keeping the earliest first_activity_date
or tagging reactivations separately.
Event loss leads to under-reported engagement. Instrument monitoring that compares source event counts with the warehouse to surface discrepancies.
Galaxy’s desktop SQL editor and context-aware AI Copilot streamline cohort-analysis workflows:
events.event_date
to events.occurred_at
, Copilot updates the query automatically.A well-built cohort dashboard uncovers the health of your user base far better than aggregate metrics. By following disciplined data modeling, efficient SQL, and thoughtful visualization—and by leveraging modern tools like Galaxy—you’ll provide your team with actionable, trustworthy retention insights.
Retention and customer lifetime value drive the economics of any recurring-revenue product. Aggregate growth masks churn, but cohort analysis reveals exactly when and why users drop off so teams can take corrective action. Without a cohort dashboard, product and marketing decisions rely on gut feel, not data.
DATE_TRUNC
, DATEDIFF
, and window functions like COUNT(DISTINCT ...)
are the workhorses. They align events to buckets and calculate unique user counts.
Daily is standard for SaaS products. Incremental models let you update recent buckets without rescanning historical data, keeping compute costs low.
Today Galaxy focuses on SQL authoring and collaboration. However, its roadmap includes lightweight visualizations—so you’ll soon preview retention heat maps without leaving the editor.
Choose a rule: assign users only to their first cohort, tag reactivations separately, or track multiple membership types. Be explicit and document your approach so metrics remain trustworthy.