Jump to content
Claris Engage 2025 - March 25-26 Austin Texas ×

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

Recommended Posts

Posted

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?

Thanks

Posted

I think this will work:

Set Field [ gRandomTemp , Round(Status(CurrentRecordCount) * Random, 0) ]

Go to Record/Request/Page [ gRandomTemp ]

  • 2 weeks later...
Posted

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 ]

Posted

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!

--ST

This topic is 7496 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.