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.
Juggernaut

Counting Summary records

Featured Replies

  • Newbies

I need to count the summarized fields in a report I am doing and am not having any luck with the count or the get summary function. I am summarizing 592 records and need to show the summarized count not the total count. A running total would be even better. Has anyone ever tried this successfully or unsuccessfully.

What EXACTLY are you trying to accomplish?

Do you mean you need to show the count of the records being summarized, rather than the total of the field being summarized?

For example: You need to count the 592 records, rather than the $587,908 that they total?

What do you actually mean when you say "running total". There is a summary field type for this, does this not give you what you want?

If I'm understanding the question, a summary field will work, just set it to be a "count of" some field included in the report. Is this what you're looking for?

  • Author
  • Newbies

No not exactly, I guess I didn't explain the problem well enough. As an example I'll use the Invoice/Customer model (this is actually for a music publishing company but that would just make this more complicated). Say I have a database with 468 Invoices. I want to do a report that summarizes/sorts the invoices by Customer and tells me the number of unique customers in that report either as a grand total or by numbering 1,2,3,4,5,6,... each individual customer. Any summary count fields that I use give me the count of Invoices instead of the count of Customers. Thanks for your input

This gets complicated since you need to count records that do not actually exist in this DB.

Start by determining how many records there are for a given customer.

cCountOfInvoices = Count ( Self by CustomerID::InvoiceNumber )

Then each record needs to divide 1 by the above so that the total of all records for a given customer totals 1.

cPortionOfTotal = 1 / cCountOfInvoices

Finally setup a summary field which totals the above field. This should result in a total of 1 for each customer. Then just display this field on a Grand Summary part (either Leading or Trailing).

sCustomerCount = Total of cPortionOfTotal

It'll look something like this:


CustomerID cPortionOfTotal sCustomerCount

1 0.33333 0.33333

1 0.33333 0.66666

1 0.33333 1.00000

2 0.25 1.25000

2 0.25 1.50000

2 0.25 1.75000

2 0.25 2.00000


and so on...

  • Author
  • Newbies

Rock on Capt Kurt-

That makes much sense. I will go try now

The really simple way is to create a layout with only a subsummary field by Customer set to create a page break after each occurrence. Sort by Customer (using your example), enter preview mode, Go to Record/Request/Page (last), and set a global to the Status(CurrentPageNumber).

I'm not exactly sure if rounding errors will affect Kurt's approach for large files.

-bd

  • Author
  • Newbies

Yeah I tried that one already, but it doesn't work for the look of the report printout.

Thanks

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.