Skip to content
View in the app

A better way to browse. Learn more.

FMForums.com

A full-screen app on your home screen with push notifications, badges and more.

To install this app on iOS and iPadOS
  1. Tap the Share icon in Safari
  2. Scroll the menu and tap Add to Home Screen.
  3. Tap Add in the top-right corner.
To install this app on Android
  1. Tap the 3-dot menu (⋮) in the top-right corner of the browser.
  2. Tap Add to Home screen or Install app.
  3. Confirm by tapping Install.

How do I make random record selections in FMP5

Featured Replies

  • Newbies

I am designing a database in FileMaker pro ver 5 and need help with the following. I want to be able to select records over a periods of time, in a random fashion. For example, one field in the record is a color. There are 4 colors, with each color having a different frequency of selection. Red might be weekly, on average over a 6 month time. Blue needs to be randomly selected on average once every 2 weeks, and so on. I also need to be able to restrict the selection to monday - friday, and exlude dates based on a list of holidays.

My talents lay outside programming, but hope to give this a good try.

Please copy any responses to [email protected]

Thanks for any assistance offered.

Doug

The hard part here is the period of time. It all depends on what you mean by "over a 6 month time". You can assign colors based upon a percentage of the number of records by using a random number. You'll have to explain how you are entering records (i.e. how often records are entered)to put in the time element.

Say you wanted Red for 10% of the records, Blue for 20%, Green for 30% and Yellow for 40% (it has to add to 100%). First give each record a random number, say upon creation:

Rand# (calculation) = Random

Next pick a color based upon the distribution of the random number (the function gives numbers from zero to one.

Color (calculation, container) =

Case(

Int(Rand# * 100) <= 10, Color = gRed,

Int(Rand# * 100) <= 30, Color = gBlue,

Int(Rand# * 100) <= 60, Color = gGreen,

Int(Rand# * 100) <= 100, Color = gYellow,

"")

This show you all the steps, actually

Case(

Int(Rand# * 100) <= 10, Color = gRed,

Int(Rand# * 100) <= 30, Color = gBlue,

Int(Rand# * 100) <= 60, Color = gGreen,

gYellow)

will work just fine. These calculations work because the tests happen in order until one succeeds, then the calculation exits. The first part creates a random integer between 0 and 100, the second part picks red for numbers from 0 to 10, green for 11 to 30, blue for 31 to 60, and yellow for 61 to 100. -bd

Create an account or sign in to comment

Important Information

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

Account

Navigation

Search

Search

Configure browser push notifications

Chrome (Android)
  1. Tap the lock icon next to the address bar.
  2. Tap Permissions → Notifications.
  3. Adjust your preference.
Chrome (Desktop)
  1. Click the padlock icon in the address bar.
  2. Select Site settings.
  3. Find Notifications and adjust your preference.