Go Premium for a chance to win a PS4. Enter to Win

x
?
Solved

Summarizing Running Totals

Posted on 2011-02-25
2
Medium Priority
?
474 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 2000 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

Free Tool: Port Scanner

Check which ports are open to the outside world. Helps make sure that your firewall rules are working as intended.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

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

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. …
Hello everyone, Hope you find this as helpful as we did. We have on the company I work for an application built in Delphi V with Crystal Reports 8. We all know that Crystal & Delphi can be temperamental sometimes and the worst thing is, nearly…
Integration Management Part 2
This lesson discusses how to use a Mainform + Subforms in Microsoft Access to find and enter data for payments on orders. The sample data comes from a custom shop that builds and sells movable storage structures that are delivered to your property. …
Suggested Courses

782 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