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

Announcements
Want to see what's currently in public preview? We've pulled it all together in one place. Check it out here
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

Labels (1)
1 Solution

Accepted Solutions
sunny_talwar
MVP
MVP

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
MVP
MVP

May be like this

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