Skip to content

user_activity_snapshots

DAU / WAU / MAU. Number of unique active learners across rolling windows of 1 / 7 / 14 / 30 days, counted from each date.

  • Grain: (id_tenant, date)
  • ETL strategy: merge
  • PK: (id_tenant, date)

When to use it

  • Engagement KPI (don't confuse with registrations).
  • Platform health — is the active base growing along with the total base?
  • Churn detection (DAU dropping while base is steady).

Columns

ColumnTypeDescription
id_tenantBIGINTFK → tenants.id. Part of PK.
dateDATEReference day for the rolling-window counts. Part of PK.
active_yesterdayINTEGERDAU — unique learners active the day before date.
active_7dINTEGERWAU — unique learners active in the last 7 days.
active_14dINTEGERUnique learners active in the last 14 days.
active_30dINTEGERMAU — unique learners active in the last 30 days.

Usage pattern

sql
-- Stickiness: DAU/MAU over the last 30 days
SELECT date,
       sum(active_yesterday) AS dau,
       sum(active_30d)       AS mau,
       round(100.0 * sum(active_yesterday)::numeric / NULLIF(sum(active_30d), 0), 2) AS stickiness_pct
FROM metrics.user_activity_snapshots
WHERE date >= current_date - interval '30 days'
GROUP BY date
ORDER BY date;

Stickiness > 20% usually indicates a healthy engagement.

OpenDB · Cademi LMS Data Warehouse