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

I have a client that wants to find the Mode of a high price of his found information. Does FMP have a Mode function? If not - what can I use to do this within FMP.

Thanks

This could be a tough one. If I remember correctly, the median is the middle value with equal numbers above and below, the mode is the most commonly occurring value or the value about which the data set clusters most closely. A set of data can have multiple modes or no mode. If you sort a data set by value and create a subsumary by value with a summary field defined as the "Count" rather than the "Total" you will get the number of instances or each data item. The most frequently occurring item(s) is (are) the mode.

To get a count and sort the unique values in order of frequency, you may have to export a summary of the data to another file and then sort by occurrences. If you sort by decreasing occurrences, the first record will be the mode, if the occurrence is greater than one. If the occurrences in the second record are greater than one occurrence and equal to the number of occurrences in the first record, both values are the mode, etc.

Hope this isn't too confusing.

-bd

Mean and mode? Someone the other day had a question on slope? What's with all this math stuff? I guess I just didn't beleive my teachers when they said math will be important in your occupation.

I'm glad there are still those out there with math skills to pay the bills.

Ken

You'd be suprised how many engineers (or former engineers) there are in the FM developer community!

-bd

There is a way to calculate Mode dynamically or, for the current found set, by script, however it requires "jumping through a couple of hoops" ...

1. Create a new number field called 'FoundAmount'.

2. Create a self-join relationship called "AmountCalc" which matches the 'FoundAmount' field to itself.

3. Create an unstored calculating field called 'AmountFrequency' (result type Number) with the formula: Count(AmountCalc:FoundAmount).

4. Create three summary fields called 'AmountMax' (defined as Maximum of 'FoundAmount'), 'AmountMean' (defined as Average of 'FoundAmount') and 'FrequencyMax' (defined as Maximum of 'AmountFrequency').

5. Create a number field called 'ModeAmount', and a global text field called 'gCurrentMode{s}'.

6. Create a value list called 'MultipleModes' which uses values from the 'ModeAmount' field.

7. Create a script which runs along the lines of:

Allow User Abort [Off]

Go to Record/Request/Page [First]

Loop

Set Field ["FoundAmount", "Amount"]

Go to Record/Request/Page [Exit after last, Next]

End Loop

Go to Record/Request/Page [First]

Loop

Set Field ["ModeAmount", "Case(AmountMean = AmountMax, "[no mode]",

AmountFrequency = FrequencyMax, FoundAmount, "")"]

Go to Record/Request/Page [Exit after last, Next]

End Loop

Set Field ["gCurrentMode{s}", "Substitute(ValueListItems("YourDBname.fp5",

"MultipleModes"), "

  • 3 weeks later...
  • Author

HI -

I finally got back to this.

I think I have it working. But my question now is - the numbers (which are prices) are always rounded to a 5 or a 0. Is there a reason for this?

Also - I have been testing this a lot. I do a find on a client and then I run the Mode Script I created. Sometimes it looks like to it is giving me the same data over and over again and not updating. I added the two extra script lines at the beginning of my script - I am hoping this is supposed to clear out the information from before.

Thanks for your advice -

  • Author

I just created a single record and ran the Mode script that I created from the above information. The only price in my record was $150, but the mode is still showing 15~35~50~500. This souldn't be - so - am I missing something in the information that you sent me.

Hello,

The procedure I described has a number of steps so, rather than going over them all with you, I thought it might be easier if I made available an example file which uses the technique.

I've now done so, and the sample is now among those posted publicly for download from my web server. The technique used in the file is along the lines of the one I suggested in my previous posting. I've tested it and it works (no rounding, no repeating previous values etc). The file is unlocked so that you can pull it apart and check all the details of how it was done.

The URL for a zip version of the download example file is:

http://www.nightwing.com.au//FileMaker/demos/ModeCalc.zip

(for a stuffit version, just change the suffix to .sit).

Perhaps if you have a look at the demo and see if you can get your own file to work along similar lines. Then if you find you're still stuck let me know.

  • Author

Thank you

As soon as I get a chance I will take a look at this and respond.

  • Author

Thank you for the updated site.

I have downloaded your demo and will it over during the next couple of days.

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.