AnsweredAssumed Answered

Picking a random set of records, with no repeats.

Question asked by jabond on Dec 2, 2014
Latest reply on Dec 2, 2014 by jabond

Good morning all,

 

I'm stuck. Here is what I'm trying to do...from a list of 240 records, pick 60 random records, marked them as being "used" and then when the script runs again, pick another random set from the remaining records. What I need is to use each record once with no repeats, and end up using all the records in the end. In the example above, I would create 4 lists of 60 randomly picked questions from the list, while not reusing any of the questions. I hope I'm making sense.

 

The only thing I have working right, is picking the random set of 60 records, but each time I run it, the number of records increases with each run (60, 120, 180, etc.)

 

Here is the script I'm using the find and mark the random questions

 

Go to Layout ["Question List 2" (Questin List 2)]

Enter Find Mode []

Insert Text [Select;Questions List 2::Marked; "Used"]

Omit Record

Perform Find []

 

Replace Field Contents [No dialog; Question List 2::RandomField; Random]

Sort Records [Restore; No dialog]

Go to Record/Request/Page [First]

Omit Multiple Records [No dialog; 60]

Show Omitted Only

 

Go to Record/Request/Page [First]

Loop

Insert Text [Select; Question List 2::Marked; "Used"]

Go to Record/Request/Page [Next;Exit after last]

End Loop

 

Thanks in advance for any help!

 

James.

Outcomes