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.

Calculating a result from multiple records

Featured Replies

  • Newbies

Hi,

First please accept my apologies if this has been asked before, but I can't seem to find an answer to my specific problem.

Within my database if have a "Jobs" table and a "Tasks" table. When a user inputs a Task, they select a job name, and cost, and the task gets sorted by ID into a portal in the relevant Jobs record.

What I'd like to be able to do, is to calculate the total cost of all tasks completed for a particular Job and display the result in a field on the Jobs layout.

Is this possible? I have attached a erd of my tables.

Hope this all makes sense,

Best wishes and thanks

ERD_JOB_TASK_copy2.jpg

Create a calc field in Jobs, TotalCost = sum ( jobs_Task::Cost).

"When a user inputs a Task, they select a job name"

Hope that's not the case. They should be selecting a JobID!

You can avoid the user needing to select a JobID if you create a new task from the Job Form.

On Job Form layout

Button: New Task

Set $jobID; Jobs::pkJobID

Go to Layout Task Form

New Record

Set Tasks::fkJobID; $jobID

  • Author
  • Newbies

Thanks for the quick reply! The solution was obvious, sorry. I didn't realise that Filemaker would auto calculate records that had the correct ID.

Yes, you're right, they select the Job ID. Actually I'm using the popup select script that you wrote to select the ID :-)

I think I had a reason for not wanting to create new Task records directly from the Job layout, but I can't remember what it was now. I guess I can have both.

Thanks Again!

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.