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!

"Running Total Field" help

Status
Not open for further replies.

kinosaidp

Programmer
Mar 5, 2007
9
0
0
US
using database: SQL2000 and Crystal Report 11

The existing report is grouped by "COMPANY"
then by "LINE". The body (located in the LINE group footer) displays the group amount by LINE and then the summary is displayed under the Company group footer. Based on the sample data below, the Company summary is a running total that should sum amounts on each change of "ID" however it does not work, it adds all the lines of the amount field instead. Am I missing something.

thanks for your help.

"SAMPLE DATA"
ID LINE COMPANY AMOUNT
20856 19.2 Company1 45
20857 19.2 Company1 456
20857 21.1 Company1 456
20858 19.2 Company1 136
20859 19.2 Company1 214
20859 21.1 Company1 214

*****************************************
LINE Amount
19.2 851
21.1 670
-------
Total by Company1 1521 <--- False Ttl

*****************************************
LINE Amount
19.2 851
21.1 670
-------
Total by Company1 851 <--- Desired Ttl
 
The problem is your group on line. When you do that, your data then looks like this:

ID LINE COMPANY AMOUNT
20856 19.2 Company1 45
20857 19.2 Company1 456
20858 19.2 Company1 136
20859 19.2 Company1 214
20857 21.1 Company1 456
20859 21.1 Company1 214

Then the running total correctly adds every amount since the ID changes with every line. You could remove the line group and sort by ID, and then use conditional running totals or formulas for the totals by line, where you use an evaluation of, e.g.,:

{table.line} = 19.2

-LB
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top