ACTIVITY_STATUS

All functions > BUSINESS > ACTIVITY_STATUS

Returns the activity status between two time periods for the given activity bits

Signatures

Returns: Activity status: 'new', 'retained', 'resurrected', 'churned', or 'stale'

ACTIVITY_STATUS(activity_bits: BIGINT, length_days_current: BIGINT, [length_days_previous: BIGINT]) → VARCHAR
sql
ParameterTypeRequiredDescription
activity_bitsBIGINTYesBit-packed activity representation
length_days_currentBIGINTYesLength of current period in days
length_days_previousBIGINTNoOptional length of previous period (defaults to current)

Notes

  • Classifies users into cohorts based on activity patterns
  • 'new': active in current period, not in previous or before
  • 'retained': active in both current and previous periods
  • 'resurrected': active in current, not in previous, but was before
  • 'churned': not active in current, but was in previous
  • 'stale': not active in current or previous periods
  • Essential for cohort analysis and retention metrics
  • Commonly used with 7, 28, or 90-day periods
Last update at: 2026/03/03 16:47:38
Last updated: 2026-03-03 16:48:19