Jump 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.

Featured Replies

Can anyone advise how to find a random 10% of my database for purposes of conducting a survey? I have 9800 records, each with an individual number. I need to select 10% at random.

Create an unstored calculation field in your database (I'll call it cRdm but the name is arbitrary):P

cRdm = Random

Make sure it's unstored, and the result type is set to number.

Then create this script:

Show all Records

Sort [by field cRdm]

Loop

Exit Loop If [status(CurrentFoundCount) <= (Status(CurrentRecordCount) / 10)]

Omit Record

End Loop

Every time you sort the database it'll sort differently (because the Random calculation will change each time because it's unstored). The loop then omits the unwanted records.

I haven't tested this but it should work.

Rather than omit 90% of the records, why not omit 10% and then do a Show Omitted? Should be quicker.

Show all Records

Sort [by field cRdm]

Loop

Exit Loop If [status(CurrentFoundCount) <= (Status(CurrentRecordCount) *.9)]

Omit Record

End Loop

Show Omitted

Wow...both cool suggestions. I'd read this earlier and was wondering how best to go about this.

I guess without the loop, it will be even quicker.

g_Percent (global number- Enter your percentage here)

cRdm =Random

SetField[g_Percent =Int(Status(CurrentRecordCount)*(g_Percent/100) )+1)]

Show all Records

Sort [by field cRdm]

GoToRecord[by Field Value - g_Percent]

OmitNext[500000-no dialog] *

Put here one of these number of records you won't never have in your file...

  • Author

Thanks guys. It works beautifully. You are all angels.

Create an account or sign in to comment

Important Information

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

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.