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.

Calculate Values from one table and display sum on another table

Featured Replies

  • Newbies

I have run into a snag.  I have two tables, one is called project and the other is called sales. The relationship between the two tables is a field called salesrep.  The project table contains information on projects, specifically three important pieces of information that I need to sum up and display information in the sales table. 

For example.  A Sales Rep will own a project and he/she will put a dollar value in the 'project_amount' field, identify which quarter the project will book in the 'billing_cycle' field and what the status is in the 'sales_projection' field. I can run manual reports all day long by searching criteria in these fields and performing a find and have that output of that find go to a layout with the search results. Pretty basic. 

 

Here is my challenge. I want to have a layout that lists all of my Sales Reps, and by their billing_cycle, have it automatically sum up all of the projects that they own with a pre-defined value, lets say the predefined value is forecast, and display that result in my sales table.

 

Remember, the project table contains the dollar amounts and the sales table contains the account reps. An Account Rep can have many projects, however, a project can only have one Account Rep.

 

What type of script could I write to have this done ?

I am not sure I understand your question, esp. this part:
 

automatically sum up all of the projects that they own with a pre-defined value, lets say the predefined value is forecast, and display that result in my sales table.


1. What exactly is "forecast"? Is it a field in the Projects table?

2. What exactly do you mean by "sum up all of the projects that they own with a pre-defined value"? Would this involve finding only (sales of) projects that meet some criteria?


IMHO, you have an inherent structural issue that may prevent you from producing some type of reports. The relationship between Projects and Sales should be based on matching ProjectID - not SalesRep. In fact, going by your own description you should have three tables, arranged as:

SalesReps -< Projects -< Sales

The way you have it now, it is impossible to determine which project a record in Sales belongs to. Therefore, you won't be able to  produce any kind of report on sales that would incorporate data from their respective parent projects.

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.