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

Counting a formula based on a subtotal 1

Status
Not open for further replies.

MeganRoss

Programmer
Mar 17, 2009
7
US
I'm writing a sales report that
first: shows our sales reps what models they've sold to their customers
second: how many customers they've sold each model
third: what % of they're customers have bought each model #

Report should look like this:
Model_110 Model_120 Model_130
Cust_1 x x
Cust_2 x x
Cust_3 x x x
Cust_4 x x
Sales Rep 2 3 4
50% 75% 100%
The x is a formula in the group footer:
if Sum ({@110}, {AA_Q_RRHeader.customer_id})>0 then "X" else ""
So how do I count the "X"s for the salesrep group?
 
Use a variable, place ths in Cust Grp Footer

@110count
whileprintingrecords;

global numbervar mod110;

if Sum ({@110}, {AA_Q_RRHeader.customer_id})>0 then
mod110:= mod110+1


In report footer

@Display110count
whileprintingrecords;

global numbervar mod110;

Ian
 
Close. The only problem is that there are multiple sales rep so I need this formula:

@Display110count
whileprintingrecords;

global numbervar mod110;

for each group not the report footer. Would a reset formula work? Any ideas?
 
Yes in group header place a reset

You can reset all in one formula

@reset
whileprintingrecords;

global numbervar mod110:=0;
global numbervar mod120:=0;
global numbervar mod130:=0;

Ian
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top