BINARY_REPRESENTATION()

All functions > BUSINESS > BINARY_REPRESENTATION()

Returns the binary representation as a string of the given activity bits

Signatures

Returns: Binary string representation of activity bits

BINARY_REPRESENTATION(activity_bits: BIGINT) → VARCHAR
sql
ParameterTypeRequiredDescription
activity_bitsBIGINTYesBit-packed activity representation

Notes

  • Converts activity bits to binary string for visualization
  • Each character is '1' (active) or '0' (inactive)
  • Rightmost character = most recent day (bit 0)
  • Useful for debugging and visual inspection
  • Example: '1010011' = active days 0, 1, 4, 6
  • Helps understand bit-packed format
  • Not for performance-critical queries

Examples

FeatureQL
SELECT
    f1 := BINARY_REPRESENTATION(3::BIGINT) -- Bits 0 and 1 set read as ones on the right in the string
;
Result
f1 VARCHAR
11

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