ACTIVITY_STATUS

All functions > BUSINESS_ACTIVITY > ACTIVITY_STATUS

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

Syntax

ACTIVITY_STATUS(activity_bits: BIGINT, length_days_current: BIGINT) → VARCHAR
sql

Arguments

ParameterTypeRequiredDescription
activity_bitsBIGINTYesBit-packed activity representation
length_days_currentBIGINTYesLength of current period in days
length_days_previousANYYesOptional length of previous period (defaults to current)

Returns

VARCHAR - Activity status: 'new', 'retained', 'resurrected', 'churned', or 'stale'

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: 2025/10/13 10:23:46