HASH01

All functions > BUSINESS_SIMULATIONS > HASH01

Returns a value between 0 and 1 based on the given hashing key.

Syntax

HASH01(hashing_key: VARCHAR) → DOUBLE
sql

Arguments

ParameterTypeRequiredDescription
hashing_keyVARCHARYesString value to hash (typically user ID or session ID)

Returns

DOUBLE - Deterministic value in range [0.0, 1.0)

Notes

  • Deterministic hash - same key always produces same value
  • Uses MD5 hashing internally
  • Uniformly distributed across [0.0, 1.0) range
  • Useful for A/B testing, sampling, and rollouts
  • Each unique key maps to a stable value
  • Foundation for other simulation functions (SAMPLE_UNIFORM, PROBABILITY_TO_EVENT)
Last update at: 2025/10/13 10:23:46