Running Total Problem

Posted on 2008-10-28
Medium Priority
Last Modified: 2011-10-19
I have a report where I am using the following formulas to create a subtotal but I am running into a problem with it creating a running total instead of a total per group.  Can you please provide me with a solution? I have attached a screenshot of what is happening.  

The Subtotal Header formula I am using is as follows:

shared numberVar DeptInformationCount;
DeptInformationCount := 0;

and the Subtotal Footer formula I am using is:

shared numberVar DeptInformationCount;

Thank you for your help with this.

Question by:SAW56
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
  • 2

Author Comment

ID: 22819943
Not sure if you need this information but this is the formula I used to originally gather the detailed information data:

shared numberVar InformationCount;
shared numberVar DeptInformationCount;
if {PROBSUMMARYM1.CATEGORY} = "information" then
(InformationCount := InformationCount + 1;
    DeptInformationCount:= DeptInformationCount+ 1;
LVL 77

Expert Comment

ID: 22819963
Add a first line of:


to both formulas.

(I assume by 'subtotal header' you mean 'Group Header')

Author Comment

ID: 22829397
For some reason it is not working.  It is still showing a running total.
LVL 77

Expert Comment

ID: 22829934
I need more info about the report structure.  There must be (at least) two grouping levels so I need to see where everything is happening.
Can you post a sample report if possible or else post a bitmap of the design view.
LVL 101

Accepted Solution

mlmcc earned 2000 total points
ID: 22837952
Agree.  We need to know where each formula is.

The WhilePrintingRecords; isn't needed because shared variables are only processed in the printing pass.

You need a formula to reset InformationCount to 0.

It should be in the other group header.


Featured Post

[Webinar] How Hackers Steal Your Credentials

Do You Know How Hackers Steal Your Credentials? Join us and Skyport Systems to learn how hackers steal your credentials and why Active Directory must be secure to stop them.

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. …
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…
Visualize your data even better in Access queries. Given a date and a value, this lesson shows how to compare that value with the previous value, calculate the difference, and display a circle if the value is the same, an up triangle if it increased…
In this video, Percona Director of Solution Engineering Jon Tobin discusses the function and features of Percona Server for MongoDB. How Percona can help Percona can help you determine if Percona Server for MongoDB is the right solution for …
Suggested Courses

764 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