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.

Counting records based on the multiple field values

Featured Replies

  • Newbies

Hi All

I'm new to FM and this forum and I thank you for taking the time to read my post.

I have two tables.

Table 1 contains data for individual jobs on record. These records are categorised as either Completed or Remaining in a 'Status' field. Records a grouped together using a 'Project Ref' field.

e.g.

Record 1

Project Ref: 00001

Status: Completed

Record 2

Project Ref: 00001

Status: Remaining

Record 3

Project Ref: 00002

Status: Completed

etc...

Table 2 contains Project information such as location and contact details but I would also like to calculate the number of Completed and Remaining jobs for each Project from Table 1.

e.g.

Project:00001

Completed:59

Remaining:5

Project:00002

Completed:12

Remaining:22

In Excel I can use either the SUMPRODUCT function or VLOOKUP/pivot tables to do this - but I don't know if there are similar functions in FM.

Can anyone help me? I can elaborate if necessary.

Thanks again

Paul

Create a global field in Table 2 that holds the text "Completed". Then establish a new relationship (named CompletedProjects for example) between Table 2 & 1 where ID=ID AND your new global field = Status. Then create a new calculation field in table 2.... Count(CompletedProjects::ID).

For remaining projects you either need to create another global with the text "Remaining" ....

or if ALL records have either Completed or Remaining in the status field then create a new relationship where ID = ID AND MyNewGlobal ("Completed") DOES NOT equal Status. Another calc Count field will be needed in either case.

  • Author
  • Newbies

Thanks for your suggestion. I did not quite follow it but I have worked out an alternative solution.

In Table 1 -

create a field called "Completed Project Jobs" with the calculation IF(Status="Completed",Project Ref).

Set up a Relationship between "Completed Project Jobs" in Table 1 and "Project Ref" in Table 2.

In Table 2 -

create a field called "Completed Total" with the calculation COUNT(Table 1::Completed Project Jobs)

This seems to work well.

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.