Crystal - Sum running total in footer  (global var)

Posted on 2013-11-14
Medium Priority
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;


PRODUCT 123456 Total Incentive: $3

Total for sales rep X  $5

Question by:kelsanit
LVL 41

Expert Comment

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

Author Comment

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

Expert Comment

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

LVL 35

Accepted Solution

James0628 earned 2000 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:

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:

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:

Global NumberVar totalincentive;
totalincentive := 0;


Featured Post

Get expert help—faster!

Need expert help—fast? Use the Help Bell for personalized assistance getting answers to your important questions.

Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

Join & Write a Comment

This shares a stored procedure to retrieve permissions for a given user on the current database or across all databases on a server.
Article by: Tammy
MySQLTuner is a script written in Perl that allows you to review a MySQL installation quickly and make adjustments to increase performance and stability. The current configuration variables and status data is retrieved and presented in a brief forma…
With just a little bit of  SQL and VBA, many doors open to cool things like synchronize a list box to display data relevant to other information on a form.  If you have never written code or looked at an SQL statement before, no problem! ...  give i…
The video provides a quick and easy steps to migrate MBOX file to well known Outlook PST and Office 365. Besides this, it also supports and migrates more than 20 email clients of MBOX which include AppleMail, Opera, Thunderbird and SeaMonkey effortl…

586 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