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.

Relation problem in the SUM function

Featured Replies

Hi all,

I have 10 tables in my db...

My problem is in the 3 of these tables...to talk more explicitly the names are

projects, orderforms and subbudgets

I have a relationship between projects and orderforms on the field projectacronym

I have a relationship between subbudgets and projects on the field subbudgetID

Thus, orderforms are indirectly related to the subbudget fields... And this indirect relationship is the one I really need and it is the source of the problem...

For instance, when I use this while defining a value list with the include only related record option, it works as expected...

However, when I use it in the sum function, by trying to take the SUM of related orderforms under a subbudget, it takes the grant sum(which means the sum of the orderforms which are related to the whole project)... And unfortunately, I have multiple subbudgets under a project. And multiple orderforms under each subbudget...

ps: I tried creating a different relationship between orderforms and subbudgets, however this creates problems in my db design and hardens lots of things, thus if anybody has an idea why this SUM is not working in this kind of a relationship, waiting for any ideas...

Best

Ersen

Thus, orderforms are indirectly related to the subbudget

So if you start with a subbudget then it is related to a project and that is related to a bunch of orderforms. So doesn't this relationship relate the subbudget to all the orderforms related to the project? which would explain why the SUM produces the sum of all the orderforms related to the project.

To produce a SUM of orderforms related to a subbudget then you need a relationship between projects and orderforms which takes the subbudget ID into account; I assume there is a subbudget ID in the orderform table. So you need a second TO of Orderforms which relates to projects both by projectacronym and SubbudgetID and then calculate the SUM via that TO.

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.