Qlik Community

QlikView App Development

Discussion Board for collaboration related to QlikView App Development.

Highlighted
hansdevr
Contributor 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
Contributor III

Re: Generate a set of random key values

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.

4 Replies
jensmunnichs
Contributor III

Re: Generate a set of random key values

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
Contributor III

Re: Generate a set of random key values

This might indeed work, Jensmunnichs, thnx! 🙂

jensmunnichs
Contributor III

Re: Generate a set of random key values

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
Contributor III

Re: Generate a set of random key values

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

Thanks for your help!