Jump to content
Claris Engage 2025 - March 25-26 Austin Texas ×
The Claris Museum: The Vault of FileMaker Antiquities at Claris Engage 2025! ×

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

Recommended Posts

  • Newbies
Posted

I'm a novice at creating formulas. I need to create a field that will calculate and add the largest five values from eight fields in eight separate tables. This value would be stored in a ninth table. Example below:

Table 1

Field: Weight

Value: 10

Table 2

Field: Weight

Value: 8

...

Table 9

Field: Total of the Five Largest Weights from Table 1 thru Table 8

(Need field calcultion formula for this field)

Any help would be appreciated,

Scooter

Posted

Join your Total table to each of the others and specify an 'X' for the join. It doesn't matter which two fields you use - any standard field will work. This will relate your Total table to all records in each table. Your weight fields must be number.

Then within your Total table, create a calculation, number with:

Max(Table1::Weight) + Max(Table2::Weight) + Max(Table3::Weight) ... etc.

If you have a lot of records, this calc can slow things down. I would question having 9 different (same/similar) tables, but that is another story. wink.gif

Posted

Hmmm, wait a minute ... you only want the tables added if they contain the top 5 highest values? I think I'd script it crazy.gif or maybe someone else has suggestions. I've seen amazing things with sorting values, particularly Custom Functions. Well, you can create a calculation in your Total Table with something like:

Max(Table 1::Weight) &

  • Newbies
Posted

I appreciate the help. It's a simple thing to want but complicated to implement. The application actually involves my Bass Fishing Club. We have 8 Tournaments a year wherein you get to count your best 5, thus I want to have the db tell me at the end of the year the sum of the best 5 results of each anglers' 8 tournaments!

smile.gif

Posted

Your tournaments contain the same fields, but are distinguished by data within certain fields, ie, Tournament # and/or Tournament Date etc. This data should, in my opinion, reside in the same table. Why? The same reasons you are bumping up against ... because extracting required data is easier if within one table.

Since noone else has responded, I will give you my (almost worthless) suggestion (short of combining them): Write each angler's total score as records into a summary table (so all exist together) and perform your calculations there.

Posted

Hi,

This would be easier this way for sure, more reliable on the long term if you have 8 tournament a year...

Your total could be based on the sum of the last items of the ValueListItems for scores for each record, which in turn, has pointed by MoonShadow would preferably be scripted because it can slow things depending on the number of records you have.

  • Newbies
Posted

Thank you both of you for your time and effort. I'm sure your suggestions will work. Since I'm not a DBA I'm sure this all looks quite amateurish but I volunteered to do this! grin.gif

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