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

ParameterTypeRequiredDescription
activity_bitsBIGINTYesBit-packed activity representation
length_daysBIGINTYesLength of time period to check
offset_daysANYYesOptional 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
Last update at: 2025/10/13 10:23:46