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!

Count instances of a BY

Status
Not open for further replies.

JoaoPinto

Programmer
Feb 12, 2003
26
US
Hi,

I have the following output

Region State Location Number of Calls
002 IL 00201E 1
00203A 1
002064 2
002078 4
00207F 1
00209A 2
MN 00210B 1
00214C 2
00217C 1
0022C1 3
002301 3
WI 0020D9 1
0020F0 1
0023BC 2


What I would like is this below, basical a total of the number of calls and a count of the number of locations.


Region State Location Number of Calls
002 IL 00201E 1
00203A 1
002064 2
002078 4
00207F 1
00209A 2

6 11

MN 00210B 1
00214C 2
00217C 1
0022C1 3
002301 3

5 10

WI 0020D9 1
0020F0 1
0023BC 2

3 4


Is this at all possible?
My code is like this

COUNT * AS 'Number of Calls'
BY LOA_REGION_CD AS 'Region'
BY LOA_STATE AS 'State'
BY AGA_ROLOC AS 'Location'
 
Try this:

COUNT thefield AS 'Number of Calls'
COMPUTE COUNTER/I2=1; NOPRINT
BY LOA_REGION_CD AS 'Region'
BY LOA_STATE AS 'State'
BY AGA_ROLOC AS 'Location'

ON LOA_REGION_CD SUBFOOT
&quot;Count : <ST.COUNTER> Call Total: <ST.CNT.thefield>&quot;

Instead of COUNT * pick the field that counts what you want



 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top