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: 
hansdevr
Creator III
Creator III

Generate a set of random key values

Dear members,

I need to generate a list of randomly picked Dossier numbers. Of course, a number of criteria which those numbers must meet, is already known (using a 'where' clause), but then I need to generate a random list, let's say a 100 Dossier numbers from a list of 10,000.

 

What is the best way of doing this?

Any help would be greatly appreciated!

Thanks,

Regards,

Hans de Vries

Labels (1)
1 Solution

Accepted Solutions
jensmunnichs
Creator III
Creator III

Maybe add a random number field to your data using the Rand() function, sort the data using this field (using the Order By clause), then load first 100 using the First load prefix. You'll have to work with temp tables and resident loads though, as you can't do all of this in a single load.

View solution in original post

4 Replies
jensmunnichs
Creator III
Creator III

Maybe add a random number field to your data using the Rand() function, sort the data using this field (using the Order By clause), then load first 100 using the First load prefix. You'll have to work with temp tables and resident loads though, as you can't do all of this in a single load.

hansdevr
Creator III
Creator III
Author

This might indeed work, Jensmunnichs, thnx! 🙂

jensmunnichs
Creator III
Creator III

No problem 🙂 If the solution works, I'd appreciate it if you came back and marked my answer as correct to close the thread 🙂

hansdevr
Creator III
Creator III
Author

LOL, I assume it will work. I'll work out the technique myself! 🙂

Thanks for your help!