Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Summing running totals fields 1

Status
Not open for further replies.

PJOL

IS-IT--Management
Oct 11, 2005
28
0
0
IE
I am using CR's version 8.5. We have a report that uses a formula called '@Setup-Time' which contains:

if {@prodgroup}='OTHERS' then {#SetupTimeOthers} else
{#SetupTime}.

SetupTimeOthers are SetupTime are running totals. I want to 'sum' these running totals. Any ideas ?

Thanks in advance.
 
Try using a variable:

//{@accum} to be placed in the same section as {@Setup-Time}:
whileprintingrecords;
numbervar setuptime := setuptime + {@Setup-Time};

//{@display} to be placed in the report footer:
whileprintingrecords;
numbervar setuptime;

If you are summing at the group level, you will need a reset formula:

whileprintingrecords;
numbervar setuptime := 0;

This assumes that {@Setup-Time} is a number datatype.

-LB




 
There is a chance that you may be able to replace those running totals with detail formulas that say something like:

if {@prodgroup}='OTHERS'
then {SetupTime}
else 0

Where {SetupTime} is the field that is being totaled in the running total. If the Running Totals are set to evaluate every record then there is probably no need for you to be using running totals. By moving the condition to the details you can then do normal subtotals and grand totals of the formula above and you don't have to resort to variables.

Ken Hamady, On-site Custom Crystal Reports Training & Consulting
Public classes and individual training.
Guides for Formulas, Parameters, Subreports, VB, .NET, Tips and Tricks
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top