×
INTELLIGENT WORK FORUMS
FOR COMPUTER PROFESSIONALS

Log In

Come Join Us!

Are you a
Computer / IT professional?
Join Tek-Tips Forums!
  • Talk With Other Members
  • Be Notified Of Responses
    To Your Posts
  • Keyword Search
  • One-Click Access To Your
    Favorite Forums
  • Automated Signatures
    On Your Posts
  • Best Of All, It's Free!
  • Students Click Here

*Tek-Tips's functionality depends on members receiving e-mail. By joining you are opting in to receive e-mail.

Posting Guidelines

Promoting, selling, recruiting, coursework and thesis posting is forbidden.

Students Click Here

Jobs

Count instances of a BY

Count instances of a BY

Count instances of a BY

(OP)
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'

RE: Count instances of a BY

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
"Count : <ST.COUNTER>  Call Total: <ST.CNT.thefield>"

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



Red Flag This Post

Please let us know here why this post is inappropriate. Reasons such as off-topic, duplicates, flames, illegal, vulgar, or students posting their homework.

Red Flag Submitted

Thank you for helping keep Tek-Tips Forums free from inappropriate posts.
The Tek-Tips staff will check this out and take appropriate action.

Reply To This Thread

Posting in the Tek-Tips forums is a member-only feature.

Click Here to join Tek-Tips and talk with other members!

Close Box

Join Tek-Tips® Today!

Join your peers on the Internet's largest technical computer professional community.
It's easy to join and it's free.

Here's Why Members Love Tek-Tips Forums:

Register now while it's still free!

Already a member? Close this window and log in.

Join Us             Close