Random Function via Table Calculations (3.38+)


(Joseph Long) #1

The rand() function can be used in table calculations to create a random number between 0 and 1. If you would like to use the rand() function in SQL to create a random sample of your data we have a discourse that outlines that process here.

To execute this function simply enter rand() in the Table Calculation modal.

##What is Jittering?
A common use case for the rand() function includes Jittering in scatterplots. Jittering allows one to add noise to a graph to avoid over plotting.

In Looker we can use the rand() function to add jitter to a scatterplot to cluster individual plot points:

No Jitter

With Jitter


Looker 3.38 Release Notes
(Thomas Vo) #2

Thanks for this functionality! Any way to set a seed?


(Dave Hunsinger) #3

Hi Thomas -

You’re welcome! There’s currently no way to set the seed, but I’d be glad to pass that idea on to our product team.

Best regards,
Dave