How to produce a Random Record.
I have over 1,000,000 records and would like to randomly "shuffle" the records.
Is that possible?
Random Number generation in Filemaker is not truly mathematically random, but works for most people.
http://help.filemaker.com/app/answers/detail/a_id/4603/~/selecting-a-random-set-of-recordsHow do I select a random set of records?http://sixfriedrice.com/wp/creating-random-numbers-in-filemaker-pro/Creating a random number with FileMaker
Thank you David,
It did not work for me.
I worked the first suggestion "How do I select a random set of records" through. However, unless I am doing something wrong , I get numbers like (.073242341 ) and not the values (the names of bird species) in the set of records that I want to randomize.
Try this calculation in a field. Also click storage options. Under Index click do not store, recalculate as needed.
Then Sort on the Random calculation field
Omit Multiple Records [No dialog; <number of records>]
Add a field that uses the random function to return a random number. The number format or value isn't important, a decimal between 0 and 1 works just fine.
Sort on this field and select the first record.
Pull all your records into a single found set and use
Go to Record[Int ( Random * Get ( FoundSet ) ) + 1]
Or if the records are in a related table, use
getNthRecord ( RelatedTable::Field ; Int ( Random * Count ( RelatedTable::PrimaryKey ) ) + 1 )
Retrieving data ...