Qlik Community

QlikView Scripting

Discussion Board for collaboration on QlikView Scripting.

ashishpalkar
Contributor II

Random Number

Hi There

How to write random number in Qlik like this.

I am using excel formula like below.

Data!B367+RANDBETWEEN(-30,30)

Thanks

1 Solution

Accepted Solutions
MVP
MVP

Re: Random Number

In your script, use e.g.

Let vNumber = ROUND(RAND()*60)-30;

The variable vNumber is updated on each reload of the script.

5 Replies
MVP
MVP

Re: Random Number

Something like

ROUND(RAND()*60) -30

ashishpalkar
Contributor II

Re: Random Number

Thanks Stefan , but this value is changing in every click. I want something where value changes only after opening / refreshing the App.

MVP
MVP

Re: Random Number

Then either calculate the number in your script or use a document OnOpen trigger action to set a variable once when opening.

ashishpalkar
Contributor II

Re: Random Number

How we can do this in Qlik sense ?

MVP
MVP

Re: Random Number

In your script, use e.g.

Let vNumber = ROUND(RAND()*60)-30;

The variable vNumber is updated on each reload of the script.