Solved

Summarizing Running Totals

Posted on 2011-02-25
2
470 Views
Last Modified: 2012-06-22
I am writing a report for my client that has a grouping by Site and a grouping by Internal Program. I then have a running total that resets on the change of grouping Internal Program which counts the distinct member id values and displays them as a total for each group. Obviously, the running total field cannot just be summed up using a summary field. Here is some sample data and what the client expects:

Program 1     50
Program 2     48
Program 3     52
Program 4     50
Site total        200

However, if I insert another running total that resets on site and get a distinct count of the member id values for the entire site grouping, I might wind up with 145 instead of 200.  The client wants 200, not 145.

How do I accomplish this?  I am assuming I would use variables, but have never tackled that before.  Any example code would be greatly appreciated.  Thanks!
0
Comment
Question by:ROTRTechTeam
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
2 Comments
 
LVL 77

Accepted Solution

by:
peter57r earned 500 total points
ID: 34982268
I can't see your client's logic in wanting such a total , because it would have no meaning, but I accept that's what you are working with.

I don't see any way of using the Running total fields because they are calculated far to late to include them in other formulas.

You need to use Insert Summary in the Program group and create a Distinct Count on the Employeeid field.
Iin the Program group footer you can then create a formula field which adds the summary to a number variable for the Site total.
Then when you reach the Site group footer you will have the Site total and can print it from another formula field.
The Site total variable  needs to be declared and set to 0 in the Site group header in a formula field.

The formula fields need to use WhilePrintingRecords as the first statement.
0
 

Author Closing Comment

by:ROTRTechTeam
ID: 34982426
Thanks! That works!
0

Featured Post

Enroll in May's Course of the Month

May’s Course of the Month is now available! Experts Exchange’s Premium Members and Team Accounts have access to a complimentary course each month as part of their membership—an extra way to increase training and boost professional development.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Crystal Reports: 5 Tests for Top Performance It is complete, your masterpiece report.  Not only does it meet your customer’s expectations, it blows them out the water, all they want is beautifully summarised and displayed in a myriad of ways. …
I hate sub reports and always consider them the last resort in any reporting solution.  The negative effect on performance and maintainability is just not worth the easy ride they give the report writer.  Nine times out of ten reporting requirements…
Exchange organizations may use the Journaling Agent of the Transport Service to archive messages going through Exchange. However, if the Transport Service is integrated with some email content management application (such as an antispam), the admini…
Are you ready to implement Active Directory best practices without reading 300+ pages? You're in luck. In this webinar hosted by Skyport Systems, you gain insight into Microsoft's latest comprehensive guide, with tips on the best and easiest way…

739 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question