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

sum of sum

Status
Not open for further replies.

mcrisf

Programmer
Mar 2, 2005
31
US
Does someone know if it is possible to do :
sum(sum(amount, salesrep), product)
or sum(max(goals, salesrep), product)?
I tried but CR says that is not possible to summarize ....even i use whileprintingrecords....
thx
 
This assumes that you have group #1 = product, and group #2 on salesrep. Your first example is probably just:

sum({table.amt},{table.product})

For the second example, you would use variables:

//{@reset} to be placed in the group header for product:
whileprintingrecords;
numbervar sumgoals := 0;

//{@accum} to be placed in the group header or footer for salesrep:
whileprintingrecords;
numbervar sumgoals := sumgoals + maximum({table.goals},{table.salesrep});

//{@display} to be placed in the product group footer:
whileprintingrecords;
numbervar sumgoals;

-LB
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top