IS_ACTIVE
All functions > BUSINESS_ACTIVITY > IS_ACTIVE
Returns whether the given activity bits is active for the given time period
Syntax
IS_ACTIVE(activity_bits: BIGINT, length_days: BIGINT) → BOOLEAN
sql
Arguments
Parameter | Type | Required | Description |
---|---|---|---|
activity_bits | BIGINT | Yes | Bit-packed activity representation |
length_days | BIGINT | Yes | Length of time period to check |
offset_days | ANY | Yes | Optional offset from reference date (default 0) |
Returns
BOOLEAN - TRUE if user was active in any day of the specified period
Notes
- Checks if user had any activity in specified time window
- offset_days=0 checks most recent period
- offset_days=7 checks week starting 7 days ago
- Returns TRUE if any bit is set in the specified range
- Fast bitwise operation (no date conversions)
- Common for defining "active user" metrics
- Use COUNT_ACTIVE to count specific days instead of boolean