Random and Limit!

Hiya - Iโ€™m trying to randomise and limit a sheet to the top 10 or so records. Iโ€™d created a virtual column using Randombetween(1,99999), the idea being that i could then only return the top n rows each time

However, the virtual column seems to be the same for each row! What am i doing wrong? Cheers

Solved Solved
0 8 266
  • UX
1 ACCEPTED SOLUTION

Iโ€™m not sure itโ€™s possible. Iโ€™ve noticed, too, that RANDBETWEEN() seems to return the same random number for the same arguments when the expression is evaluated across many columns at once. You could try varying the arguments:

(RANDBETWEEN([_ROWNUMBER], (999999 + [_ROWNUMBER])) - [_ROWNUMBER])

View solution in original post

8 REPLIES 8

can anyone give me a hand with this? Iโ€™m a little wet behind the ears with it!

So, i have a single table of data. I want to be able to display 10 or so rows randomly from that data in a list. How can I do that? When I try randombetween i get the same number on each row in the app. I want to use this virtual column to sort the data, and potentially limit the data to only 10 rows.
thanks for any help!

Iโ€™m not sure itโ€™s possible. Iโ€™ve noticed, too, that RANDBETWEEN() seems to return the same random number for the same arguments when the expression is evaluated across many columns at once. You could try varying the arguments:

(RANDBETWEEN([_ROWNUMBER], (999999 + [_ROWNUMBER])) - [_ROWNUMBER])

hi steve,

do you mean that randbetween() may not correctly randomize? Iโ€™d like to randomize the order of ten images in a gallery ux, and tried different suggestions in other posts for more complicated random solutions, but i canโ€™t seem to get just a basic random function to work.

any help or suggestions is really appreciated, thanks!

โ€œCorrectlyโ€ is subjective. Did you read my post above?

thanks for your quick reply! i did read your post and the others about randomizing with more requirements, so apologies for not quite understanding. my table has three rows (id, name, url), and iโ€™d like to randomize the order of the rows in the gallery ux. is there a basic expression and where exactly would it go in order to be able to do that? thanks again for your help.

Iโ€™d suggest you try the expression I gave above:

Let us know if that works for you.

ah wonderful! that does it! Cheers

Thanks Steve, that works!

Top Labels in this Space