Skip to main content
Announcements
Have questions about Qlik Connect? Join us live on April 10th, at 11 AM ET: SIGN UP NOW
cancel
Showing results for 
Search instead for 
Did you mean: 
brf10043
Creator
Creator

Select random value

Guys,

I have a table that contains 17 tips for users.  The table has an ID and a Tip (Text).  I want to have a text object that randomly displays on of the tips.

I don't care if the system randomly selects a Tip based on a user logging in or randomly selects a Tip a load to display to everyone that logins in until the next refresh when a different Tip is randomly selected by the load.

This sounds pretty straight forward, but I haven't been able to make it work.

Thanks for any suggestions that you might have.

1 Solution

Accepted Solutions
swuehl
MVP
MVP

A variable at load time

Let vRand = Ceil(RAND()*17);

and a text box with

=Only({<TipID = {$(vRand)}>} Tip)

should do what you want.

(instead of creating the variable during load, you can probably also use an OnOpen trigger action)

View solution in original post

3 Replies
swuehl
MVP
MVP

A variable at load time

Let vRand = Ceil(RAND()*17);

and a text box with

=Only({<TipID = {$(vRand)}>} Tip)

should do what you want.

(instead of creating the variable during load, you can probably also use an OnOpen trigger action)

brf10043
Creator
Creator
Author

That did it!  Thanks !

Ehsan1
Contributor
Contributor

Hi

I have a list containing unique code and name
I want to select one or more names randomly
Thank you for your help