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
Parameter | Type | Required | Description |
---|---|---|---|
activity_bits | BIGINT | Yes | Bit-packed activity representation |
length_days_current | BIGINT | Yes | Length of current period in days |
length_days_previous | ANY | Yes | Optional 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