SAMPLE_GAUSSIAN

All functions > BUSINESS > SAMPLE_GAUSSIAN

Returns a value chosen from a normal distribution between two bounds based on the given hashing key.

Signatures

Returns: Deterministic value from normal distribution, clamped to [lower, upper]

SAMPLE_GAUSSIAN(hashing_key: VARCHAR, mean: DOUBLE, stdev: DOUBLE, lower: DOUBLE, upper: DOUBLE) → DOUBLE
sql
ParameterTypeRequiredDescription
hashing_keyVARCHARYesString value to hash (typically user ID or session ID)
meanDOUBLEYesMean of the normal distribution
stdevDOUBLEYesStandard deviation of the distribution
lowerDOUBLEYesLower bound (values clamped to this minimum)
upperDOUBLEYesUpper bound (values clamped to this maximum)

Notes

  • Deterministic - same key always produces same value
  • Uses Box-Muller transform to generate normal distribution
  • Values follow Gaussian/bell curve centered at mean
  • Results clamped to [lower, upper] bounds
  • Useful for realistic simulations with natural variation
  • Common for modeling human behavior, response times, usage patterns
Last update at: 2026/03/03 16:47:38
Last updated: 2026-03-03 16:48:19