Qlik Community

New to QlikView

Discussion board where members can get started with QlikView.

Announcements
QlikWorld 2020: Join us May 11 - 14, 2020 in Phoenix, AZ. Register early and save $400. Learn More
Highlighted
Not applicable

How to create Random number within specific range in Qlikview/Qliksense in script ?

Hi,

How can we create random number between specific range.

Let us suppose we need to generate random no. between 0.85 to 1.05, how can we do it ?

Thanks in advance.

1 Solution

Accepted Solutions
MVP
MVP

Re: How to create Random number within specific range in Qlikview/Qliksense in script ?

[TenRandomNumbers]:

LOAD

     Rand() * (1.05-0.85 ) + 0.85  AS myRandomNumber

AUTOGENERATE

     10;

If you need it to include 1.05 exactly then add a Round()-function like this

     Round( Rand() * (1.05-0.85 ) + 0.85 , 0.01) AS myRandomNumber

View solution in original post

2 Replies
MVP
MVP

Re: How to create Random number within specific range in Qlikview/Qliksense in script ?

[TenRandomNumbers]:

LOAD

     Rand() * (1.05-0.85 ) + 0.85  AS myRandomNumber

AUTOGENERATE

     10;

If you need it to include 1.05 exactly then add a Round()-function like this

     Round( Rand() * (1.05-0.85 ) + 0.85 , 0.01) AS myRandomNumber

View solution in original post

Not applicable

Re: How to create Random number within specific range in Qlikview/Qliksense in script ?

Thanks a lot, it worked.