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.

Filtering Detail Records for Summary Calcs

Featured Replies

  • Newbies

Hi all! I could use some advice on performing a find...

Namely, I have two related tables: a detail table that contains detail records, and a summary table that contains a calculated sum() based on an amount in the detail table.

(For other design considerations, I need to have the calculated sum() in a separate table.)

I would like to filter the detail records based on one of the attributes in the detail table so that the sum() in the summary table reflects a total amount only on the found set of detail records.

So, I created a script - here's a rough description of it:

Go to the summary layout

Find all records

Enter find mode

Set field detail.amount to the filter value

(The detail table is related to the summary table)

Perform find

After running this, the summary result reflects the total amount of all of the detail records, not the found set I was aiming for.

Any ideas would be really appreciated!

Thanks,

Sharon

That's how it works - relationships ignore the found set. It must be so, because there can be many found sets: each user and each window can have a different found set of the same table, and a relationship wouldn't "know" which one is preferable.

It's hard to tell with so few details, but your best option is probably to filter the relationship (or a second relationship) by the same criteria used for the find.

  • Author
  • Newbies

Hmm, could you say a little more about how to filter a relationship?

I know I was skimpy on details...I can post more if it looks necessary.

Thanks!

Sharon

  • Author
  • Newbies

Is this what you were thinking?:(

Add a global field to my summary table and join it to the field in my detail table that I want to filter on.

Then when I enter the filter value into the global field in the summary table, that should filter the detail records?

Thanks,

Sharon

There are several ways to filter a relationship. The attached example uses a global field in the parent table to set a threshold for the child's value. Examine the relationship's definition. You can add more criteria there to further narrow the filter.

You can also use a calculation field instead of a global - this is preferable when there's no user input of the filter criteria.

Another way is to set up a calculation field in the Child table, along the lines of:

Case ( ; ParentID )

Then you base the second relationship on this field.

FilterChildren.fp7.zip

  • Author
  • Newbies

Many thanks! I really appreciate the help!

Sharon

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.