Solved

Summarizing Running Totals

Posted on 2011-02-25
2
466 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
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

Courses: Start Training Online With Pros, Today

Brush up on the basics or master the advanced techniques required to earn essential industry certifications, with Courses. Enroll in a course and start learning today. Training topics range from Android App Dev to the Xen Virtualization Platform.

Question has a verified solution.

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

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…
There have always been a lot of questions related to when Crystal Reports evaluates report components (such as formulas, summaries, cross-tabs, charts, to name a few examples). Crystal Reports uses a two-pass reporting process to provide greater …
This Micro Tutorial hows how you can integrate  Mac OSX to a Windows Active Directory Domain. Apple has made it easy to allow users to bind their macs to a windows domain with relative ease. The following video show how to bind OSX Mavericks to …
Two types of users will appreciate AOMEI Backupper Pro: 1 - Those with PCIe drives (and haven't found cloning software that works on them). 2 - Those who want a fast clone of their boot drive (no re-boots needed) and it can clone your drive wh…

776 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