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.

Calculated field always uses report total

Featured Replies

I have a report that calculates the number of units per hour by dept.

The report is sorted by dept.

I have a summary field for each dept that calculates total hours worked in the dept.

QTY is the number of units that will be divided. It does not change (not a global field however)

The calculation is simple: QTY divided by that summary field.

Problem is:

Calculation will always put the result of QTY/ total hours worked by all dept together and show the same number everywhere.

The result only makes sense for report total.

CalculationError.PNG

  • Author

Have a look at the GetSummary function.

GetSummary seemed to be the solution. I had already been through that.

I lost a couple hours on it only to end up with ? values.

I don't think I understand how to make it work.

It's sad because I used to make reports like this many years ago with Foxpro (SQL) and never ran into this kind of bug.

Is there another way to solve the problem ?

Why don't you post a file showing the problem? It's difficult to understand your setup, esp. this part:

QTY is the number of units that will be divided. It does not change (not a global field however)

If it's not in a global field, then where is it?

  • Author

Why don't you post a file showing the problem? It's difficult to understand your setup, esp. this part:

If it's not in a global field, then where is it?

The sum of hours is in HOURS,the main table of the report

the sub-summary is by DEPARTMENT (a second table)

The field QTY is from a third table (ORDERS)

(See the attached screen capture on my first post)

I did successfully use GetSummary on another report, but the fields requested were all in the same table. That was easy.

Since I'm not English speaking, there are some technical informations that get me really confused. I'm not sure in this case what is my breakField in the formula!

See the attached screen capture on my first post

I have seen it - but it doesn't tell me anything about your setup.

the sub-summary is by DEPARTMENT (a second table)

GetSummary() will not work with a breakfield from a related table. You must use a "local" field as the breakfield (and adjust the sub-summary part and the sort order accordingly).

The field QTY is from a third table (ORDERS)

This is meaningless when we don't know what is the relationship between HOURS and ORDERS.

  • Author

Case solved.

I never needed to use GetSummary in the first place.

All I had to do was add the option on the summary field '' restart when sorted by''

Then everything fell in place.

To think that I had the solution all that time just in front of my nose !!

Thanks to everyone.

No, you don't have to use GetSummary() - but it is more flexible. For example, in your case it would eliminate the need to add the extra field, and the calculation would also work in a leading sub-summary.

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.