FROM_ACTIVITY_BITS

All functions > BUSINESS_ACTIVITY > FROM_ACTIVITY_BITS

Returns the activity dates for the given activity bits and date reference.

Syntax

FROM_ACTIVITY_BITS(activity_bits: BIGINT, date_ref: DATE) → `ARRAY<DATE>`
sql

Arguments

ParameterTypeRequiredDescription
activity_bitsBIGINTYesBit-packed activity representation
date_refDATEYesReference date to decode activity relative to

Returns

ARRAY<DATE> - Array of dates when user was active

Notes

  • Decodes bit-packed activity back to array of dates
  • Inverse of TO_ACTIVITY_BITS
  • Each set bit becomes a date in the result array
  • Bit 0 (LSB) maps to reference date
  • Bit 1 maps to day before reference date, etc.
  • Up to 56 days of history
  • Useful for debugging or exporting activity data
Last update at: 2025/10/13 10:23:46