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

Totals

Status
Not open for further replies.

dodge20

MIS
Jan 15, 2003
1,048
US
I have an ACE report where I am computing totals. Each total is based on certain criteria. My question is how do I get a group total of the computed totals. Is it possible to use an alias? Here is the code so far.

before group of hist_coopcode
if hist_coopcode = "lis" then
print "Coop Code: ",hist_coopcode,column 15," = ",column 18,
total of (hist_sze * 3.00) using "####.##"
else if hist_coopcode = "021" then
print "Coop Code: ",hist_coopcode,column 15," = ",column 18,
count * 6 using "####.##"
else if hist_coopcode = "017" then
print "Coop Code: ",hist_coopcode,column 15," = ",column 18,
count * 3 using "####.##"
else if hist_coopcode = "001" then
print "Coop Code: ",hist_coopcode,column 15," = ",column 18,
count * 3 using "####.##"
on last row
print "Total sales:" (NEED Something here)
end Dodge20
If it ain't broke, don't fix it.
 
Ok, I think that it is possible to save the aggregate value from one group of rows in a variable in order
to use it to compute an aggregate over a subsequent group.

Does anyone know how?
Dodge20
If it ain't broke, don't fix it.
 
I also figured this out for those interested.

In either the page header or an after group of clause you can define what you want variables to be. A small section is posted below.

define
variable userbdate date
variable useredate date
variable total1 char(10)
variable total2 char(10)
variable total3 char(10)
variable total4 char(10)

Page header
let total1 = total of (hist_sze * 3.00)
let total2 = count * 6
let total3 = count * 3
let total4 = count * 3

On last row
Print (total1 + total2 + total3 + total4) Dodge20
If it ain't broke, don't fix it.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top