Solved

Crystal - Sum running total in footer  (global var)

Posted on 2013-11-14
4
735 Views
Last Modified: 2013-11-15
Report has two groups:

group 1: Sales Rep
Group 2: Product

in group 2 footer I have a formula called "incentive" that uses two running totals to return a value.

Footer Group 1: I want to return the sum of "incentive" in group 1 footer but not sure how to do that.

I tried using globalvar but can not get to work correctly (see below)


Global Numbervar totalincentive;

Local numbervar numout3 :=0;

numout3:={@Total Incentive};

totalincentive:= totalincentive + numout3;


DATA EXAMPLE:

PRODUCT 12345  TOTAL INCENTIVE: $2
PRODUCT 123456 Total Incentive: $3

Total for sales rep X  $5

numout3
0
Comment
Question by:kelsanit
[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
4 Comments
 
LVL 40

Expert Comment

by:Kyle Abrahams
ID: 39649141
Just use another runnning total for incentive and reset on group 1 data not group 2 data.
0
 

Author Comment

by:kelsanit
ID: 39649286
I can not do that because the calculation for incentive is specific to that line.
0
 
LVL 101

Expert Comment

by:mlmcc
ID: 39649419
Try adding WhilePrintingRecords; as the first line of the formula.

mlmcc
0
 
LVL 35

Accepted Solution

by:
James0628 earned 500 total points
ID: 39650835
FWIW, I agree with mlmcc's suggestion to add WhilePrintingRecords.

 The formula that you posted doesn't need the numout3 variable.  You can use it if you like, but it's not necessary.  You could just have:

WhilePrintingRecords;
Global NumberVar totalincentive;
totalincentive:= totalincentive + {@Total Incentive}


 You might also want to create a formula that just declares the variable, and put that formula in the Report Header:

WhilePrintingRecords;
Global NumberVar totalincentive;
""

 The "" is just so that the formula doesn't produce any visible output on the report.  You could also just suppress the formula, or the section.


 And if you're looking for a total for group 1, then you're presumably going to want to reset that total for each new group 1.  You could put a formula like the following in GH1:

WhilePrintingRecords;
Global NumberVar totalincentive;
totalincentive := 0;
""


 James
0

Featured Post

[Webinar] Learn 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. Thursday, July 13, 2017 10:00 A.M. PDT

Question has a verified solution.

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

'Between' is such a common word we rarely think about it but in SQL it has a very specific definition we should be aware of. While most database vendors will have their own unique phrases to describe it (see references at end) the concept in common …
I'm trying, I really am. But I've seen so many wrong approaches involving date(time) boundaries I despair about my inability to explain it. I've seen quite a few recently that define a non-leap year as 364 days, or 366 days and the list goes on. …
Come and listen to Percona CEO Peter Zaitsev discuss what’s new in Percona open source software, including Percona Server for MySQL (https://www.percona.com/software/mysql-database/percona-server) and MongoDB (https://www.percona.com/software/mongo-…
This video Micro Tutorial shows how to password-protect PDF files with free software. Many software products can do this, such as Adobe Acrobat (but not Adobe Reader), Nuance PaperPort, and Nuance Power PDF, but they are not free products. This vide…

726 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