cancel
Showing results for 
Search instead for 
Did you mean: 

Help with selecting 10 random records from all records meeting report selection criteria in Crystal 11

Former Member
0 Kudos

<p>I am trying to select ten random records from all that match the report selection criteria then report on each of these random records for QA/QI. I have tried the RND function however it is giving me a random number rather than a random record selection. I cannot figure this out and am despirately seeking assistance.</p><p>Thank you,</p><p>Amy</p>

Accepted Solutions (1)

Accepted Solutions (1)

robert_horne
Advisor
Advisor
0 Kudos

<p>I don&#39;t know of any Random record selection functions but maybe you could write your own custom function inside of a record selection to randomly filter the records. You would use the Rand function we currently have to decide if a record was included in the report data or not.</p><p>Another possible option is to filter the records before they get to the report. You can only do this if you are pushing the data into the report instead of having the report pull the data. An example of this would be passing an ado recordset to a report at runtime. </p><p>Rob Horne</p><p>http://diamond.businessobjects.com/blog/10 </p>

Former Member
0 Kudos

Perhaps create an array (YourArray) of 10 numbers and use the RND() function to get those numbers. (Make sure this is done beforereadingrecords).

Then do a check of RecordNumber() in YourArray. Then perhaps use an on-demand subreport to only get the info that you need for those 10 records (when the user wants it) or use it as a start position for a record set (like Robert mentioned).

Hope that helps.

- Kathryn Webster (Report Design Consultant)

Answers (0)