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 strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Running total 1

Status
Not open for further replies.

RemJamie

IS-IT--Management
Jan 21, 2005
22
CA
I have a formula to calculate a running total.

IF {TATX1030.TIMECODE_I}="UA" then
countua := countua+1

I need to be able to use the final total of the field in another calculation.
Is there any way to do this with the formula I have or is there some other way to calculate the total?

Any help is appreciated.
 
If you made it a regular running total, then any formula could use the value. Much easier than doing the same things with formulas.

ight-click on a field and choose Insert to get a choice of Running Total or Summary. Or else use the Field Explorer, the icon that is a grid-like box, to add running totals.

Running totals allow you to do clever things with grouping and formulas. They also accumulate for each line, hence the name. The disadvantage is that they are working out at the same time as the Crystal report formats the line. You cannot test for their values until after the details have been printed. You can show them in the group footer but not the group header, where they will be zero if you are resetting them for each group.

Summary totals are cruder, but are based directly on the data. This means that they can be shown in the header. They can also be used to sort groups, or to suppress them. Suppress a group if it has less than three members, say. They default to 'Grand Total', but also can be for a group.

[yinyang] Madawc Williams (East Anglia, UK). Using Windows XP & Crystal 10 [yinyang]
 
You could also use a similar formula

IF {TATX1030.TIMECODE_I}="UA" then 1 else 0

If you then add a summary of this field at whatever level you require, this summary can be used in any subsequent formulas.

The advantage of using summaries over running totals is that they can be displayed anywhere in the report, where as running totals can only be displaed in footer sections.

HTH




Gary Parker
MIS Data Analyst
Manchester, England
 
Thanks guys, my HR department will be very happy to have those calculations working properly.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top