IS_ACTIVE

All functions > BUSINESS > IS_ACTIVE

Returns whether the given activity bits is active for the given time period

Signatures

Returns: Number of active days in the specified period

IS_ACTIVE(activity_bits: BIGINT, length_days: BIGINT, [offset_days: BIGINT]) → BIGINT
sql
ParameterTypeRequiredDescription
activity_bitsBIGINTYesBit-packed activity representation
length_daysBIGINTYesLength of time period to count
offset_daysBIGINTNoOptional offset from reference date (default 0)

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: 2026/03/03 16:47:38
Last updated: 2026-03-03 16:48:19