Jump to content

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

Recommended Posts

Posted

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

Posted

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

Posted

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

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 -

Posted

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.

Posted

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.

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