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.

Finding Min & Max of a Relationship

Featured Replies

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

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.

Hi,

Or create a statistic field xxMax and XXMin in the expressions in the related FloorPlan Table. Then just drop it on the Layout whatever the sort is.

HTH

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.