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

Count Records in Related Table

Featured Replies

This is pretty a simple request that does not seem to work. I have two tables Parent and Child. I want the Parent record (of which there is only) to display the number of Child records in each parent set. In the Child table I have field 'k one' (a calc with a value of 1). In the Parent I have a calc field Count(Child::k one). No matter what I do the value is always 1 on all of the parent records, but it should read 25, 65, 44, etc depending on the number of child related records. What am I missing?

Thanks in advance,

David

First place to check is to make sure the calculation is unstored (in the field definition dialog, click options, then Storage options, then check the "Do not store..." checkbox.

  • Author

Yes it is unstored. The relationship works for other uses, just not for the Count function. This is so simple and also very confusing.    This is the calc:   Count ( Tracks::k one )

To me, there are better ways to count child records:

1. create a summary field in the child table, count_of_records = count of primary key. Display that field on the parent form.

2. create a count (relationship_from_parent_to_child::child_primary_key) in the parent table.

3. Use SQL.

Really no need for a dedicated "k one" field in the child.

  • Author

I also tried option1. The calculation in the child table is correct, but when I display that in the parent table it is 0. It is almost like it is totally ignoring the relationship, but the relationship is simple connection of two number fields that DO match.

Just for reference I tried  approach 1 & 2 in a new solution and it worked fine.

  • Author

Just figured it out. I had two fields named the same, but one had an underscore. Thanks for the input though.

Create an account or sign in to comment

Important Information

By using this site, you agree to our Terms of Use.

Account

Navigation

Search

Search

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.