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

Finding Min & Max of a Relationship


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

Recommended Posts

Posted

I need to calculate the minimum and maximum selling price for a subdivision.

Here's how the data is structured:

Each 'FloorPlan' is a record which has, among other fields, a selling price. There are multiple Floor Plan records. Each record also has the key of its parent record, the subdivision. So I have a relationship between each subdivision and all its related Floor Plans.

I know I can script the finding of the min and max but that isn't a great technique. How can I do it in 1 or more calcs (using FM8 Advanced)?

Steve

Posted

You didn't say it, but I'm assuming you want to then show the min and max floor plan selling price in a Subdivision record/layout.

You can add a calc for each in the Subdivision table, where:

MaxFloorplanPrice (calculation, number result) = max(FloorPlan::Selling Price)

and

MinFloorplanPrice (calculation, number result) = min(FloorPlan::Selling Price)

Or you can define two additional TOs of FloorPlan, one sorted by Selling Price ascending, and one sorted by Selling Price descending. Then just place the related Selling Price field from each relationship onto the Subdivision layout.

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