Jump to content

goto random record number

This topic is 7141 days old. Please don't post here. Open a new topic instead.

Recommended Posts

I know there is a function in filemaker to generate a random number.

Has anyone successfully applied this to make a script to go to a random record?

All our records obviously have an id in the format II#xxxxxx where x is an updating serial number.

Any ideas?


Link to comment
Share on other sites

  • 2 weeks later...

There's a slight flaw in Ender's formula which will give a skewed distribution. The last record will only have half the chance of being picked that the other records have. Also, there is a chance the formula will return a zero value, and there is no corresponding record zero. To give a fair distribution, the round function should be replaced with Int as follows:

Set Field [ gRandomTemp , Int(Status(CurrentRecordCount) * Random)+1 ]

Go to Record/Request/Page [ gRandomTemp ]

Link to comment
Share on other sites

Hi, folks! IMO BobWeaver is among the top experts at FMFORUMS and personally, I am glad for his input and corrections -- and especially his explanations when he is generous enough to provide them. He's one of the reasons FMFORUMS is so helpful to so many of us. I can think of many scenarios where not having a truly random (ha! truly random!) solution could be problematic and raise issues of liability. What if FMFORUMS randomized the ad banners w/an inaccurate function and an unhappy customer wondered why his/her banner was not showing up as much as other advertisers? Uh.. ooopss.. sorry, Stephen, maybe we shouldn't go there, eh?

Anyway, you get my point, eh? So, thanx, Bob! Keep us honest and keep FMFORUMS creditable!


Link to comment
Share on other sites

This topic is 7141 days old. Please don't post here. Open a new topic instead.

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
  • Create New...

Important Information

By using this site, you agree to our Terms of Use.