Skip to content
Telemetry
Product analytics SQL recipe

Calculate DAU, WAU, and product stickiness

Measure daily and weekly active users together and calculate DAU-to-WAU stickiness from a consistent activity definition.

Advancedproduct_eventsReviewed 2026-07-27Tested with Apache DataFusion 45.2.0

Reviewed by the Telemetry product team on . We checked the SQL syntax, required event fields, sample results, and limits on using the query. Who reviews this page

Question answered

What share of weekly active users returns on an average day?

Keep the same user definition and qualifying activity when comparing periods. Stickiness measures the share of weekly active users who were active on a given day.

Event schema

Fields the query expects

FieldTypeWhy it exists
timestamp_utcTimestampActivity time.
user_idUtf8Stable actor identifier.
event_nameUtf8Qualifying product action.
DataFusion SQL

Copy the query

sql
WITH daily_users AS (
  SELECT DISTINCT
    date_trunc('day', timestamp_utc) AS activity_day,
    user_id
  FROM product_events
  WHERE timestamp_utc >= now() - INTERVAL '35 days'
    AND event_name IN ('feature_used', 'dashboard_viewed', 'query_run')
),
days AS (
  SELECT DISTINCT activity_day
  FROM daily_users
),
activity AS (
  SELECT
    days.activity_day,
    COUNT(DISTINCT CASE
      WHEN daily_users.activity_day = days.activity_day
      THEN daily_users.user_id
    END) AS dau,
    COUNT(DISTINCT daily_users.user_id) AS wau
  FROM days
  JOIN daily_users
    ON daily_users.activity_day BETWEEN
      days.activity_day - INTERVAL '6 days' AND days.activity_day
  GROUP BY days.activity_day
)
SELECT
  activity_day,
  dau,
  wau,
  100.0 * dau / NULLIF(wau, 0) AS stickiness_pct
FROM activity
ORDER BY activity_day;

This read-only query is planned and executed against an empty typed table with Apache DataFusion 45.2.0. We review the synthetic sample output separately. Check field types, thresholds, and counting rules against your own data. Read the testing methodology.

Query result

Daily active users

Daily activity increased across the final three complete days.

activity_daydauwaustickiness_pct
2026-07-258125,12015.86
2026-07-268465,24416.13
2026-07-279105,40816.83

Synthetic example output. Run the query against your own event schema and thresholds before using it for operational decisions.

Daily active users: static chart of synthetic dau values from the Calculate DAU, WAU, and product stickiness example result
Download this SVG chart of the sample results for an article, runbook, or design review. Please credit Telemetry.

Reproduce the example

Download the sample data

The JSON bundle includes the event schema with field types, illustrative input rows, exact SQL, expected output, review notes, and engine version. The CSV contains the displayed result.

How the SQL works

  1. 1The first CTE deduplicates repeated qualifying events by user and day.
  2. 2Joining each reporting day to the preceding seven activity days produces an exact distinct WAU denominator.
  3. 3Stickiness is the day's distinct active users divided by that day's rolling distinct weekly active users.

Edge cases to check

  • Do not use page views or sign-ins if they are inconsistent proxies for meaningful activity.
  • Anonymous-to-identified user merging changes distinct counts.
  • Exclude incomplete current days from reporting comparisons.

Recommended dashboard

  • Trend: DAU and exact WAU
  • Stat: DAU/WAU stickiness
  • Table: active users by plan or acquisition source

Alert guidance

Use anomaly or sustained-change review rather than paging on normal daily engagement variation.

Read alert setup

Set up the events this query needs

Related instrumentation and guides

Continue the analysis

Run it on your events

Create a table, adapt the fields, and save the result

Start free, send structured events, and use the query result as a chart, shared dashboard widget, or alert input.

Get an API key