Skip to main content
Announcements
Qlik Connect 2024! Seize endless possibilities! LEARN MORE
cancel
Showing results for 
Search instead for 
Did you mean: 
talita_verdes
Partner - Contributor III
Partner - Contributor III

Random value

Good afternoon!


I am not sure how to make a random value in a field.



For example:


If the field A = 2 then random between 1 and 10, if field A = 3 then random between 40 and 60.



I used it, but it did not work:



- Interval

- IntervalMach

- Rand


What can I do?


Thanks

1 Solution

Accepted Solutions
sunny_talwar

May be like this

If(A = 2, Rand() * (10-1) + 1, If(A = 3, Rand() * (60-40) + 40))  as RandNum

View solution in original post

2 Replies
vishsaggi
Champion III
Champion III

Quite did not get that. Can you explain a little with some sample data and expected output you are looking for?

sunny_talwar

May be like this

If(A = 2, Rand() * (10-1) + 1, If(A = 3, Rand() * (60-40) + 40))  as RandNum