FROM_ACTIVITY_BITS()

All functions > BUSINESS > FROM_ACTIVITY_BITS()

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

Signatures

Returns: Array of dates when user was active

FROM_ACTIVITY_BITS(activity_bits: BIGINT, date_ref: DATE) → ARRAY<DATE>
sql
ParameterTypeRequiredDescription
activity_bitsBIGINTYesBit-packed activity representation
date_refDATEYesReference date to decode activity relative to

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

Examples

FeatureQL
SELECT
    f1 := FROM_ACTIVITY_BITS(3::BIGINT, DATE '2025-01-21') -- Decode bits 0 and 1 as dates relative to the reference day
;
Result
f1 ARRAY
[2025-01-21, 2025-01-20]

Last update at: 2026/05/26 17:22:09