Solved

Summarizing Running Totals

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

Enabling OSINT in Activity Based Intelligence

Activity based intelligence (ABI) requires access to all available sources of data. Recorded Future allows analysts to observe structured data on the open, deep, and dark web.

Join & Write a Comment

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…
Excel styles will make formatting consistent and let you apply and change formatting faster. In this tutorial, you'll learn how to use Excel's built-in styles, how to modify styles, and how to create your own. You'll also learn how to use your custo…
This video demonstrates how to create an example email signature rule for a department in a company using CodeTwo Exchange Rules. The signature will be inserted beneath users' latest emails in conversations and will be displayed in users' Sent Items…

744 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

Need Help in Real-Time?

Connect with top rated Experts

10 Experts available now in Live!

Get 1:1 Help Now