Do not input private or sensitive data. View Qlik Privacy & Cookie Policy.
Skip to main content

Announcements
See why IDC MarketScape names Qlik a 2025 Leader! Read more
cancel
Showing results for 
Search instead for 
Did you mean: 
francoiscave
Partner - Creator III
Partner - Creator III

Generate random value

Hi community,

I want to use the rand() function to generate some value at random between 0 and 255.

How can I do that ?

François

1 Solution

Accepted Solutions
MarcoWedel

Ceil(Rand()*n)

delivers values from 1 to n, while

Floor(Rand()*n)

delivers values from 0 to n-1.

hope this helps

regards

Marco

View solution in original post

7 Replies
alexandros17
Partner - Champion III
Partner - Champion III

try with

=Floor(rand()*255)

let me know

Colin-Albert
Partner - Champion
Partner - Champion

FLOOR(RAND() * 255)

Anonymous
Not applicable

Try something like this:
ceil(rand()*255)

consenit
Partner - Creator II
Partner - Creator II

Hi there.

Try:

TEST:

LOAD FLOOR(Rand()*256)  as RandomValue autogenerate 1000;

Kind regards,

Ernesto.

MarcoWedel

actually it's

Floor(Rand()*256)

hope this helps

regards

Marco

MarcoWedel

Ceil(Rand()*n)

delivers values from 1 to n, while

Floor(Rand()*n)

delivers values from 0 to n-1.

hope this helps

regards

Marco

marchoctober
Creator
Creator

Hi!

Go to Ctnrl+E, there Insert > Test Script.

It generates very interesting things, so using it logic you could adopt for your solution.