DATA Step, Macro, Functions and more

Extracting the Count based on Conditions

Reply
Occasional Contributor
Posts: 7

Extracting the Count based on Conditions

Hii, Please help , I have BASE DATA in which I have category-wise Customers I want to give the Customers to each employee based on category, (which I have mentioned the Count) - RESULT REQUIRED TABLE There should not be duplicate of customers Example :- Emp 1 want 27 customer from category A so , pull or extract the Customers from BASE DATA table category A ,So after the extraction the count remaining should be ( 8000-27 = 7973) , for EMP 2 , We want 21 from A category so pull out customers form BASE DATA category A (7973).
Super User
Posts: 10,035

Re: Extracting the Count based on Conditions

So what kind of output would you like to see ?
Occasional Contributor
Posts: 7

Re: Extracting the Count based on Conditions

I would like to see the CUSTOMER , CATEGORY , EMP
Super User
Posts: 10,035

Re: Extracting the Count based on Conditions

NO. I mean the result table as you showed in your EXCEL .
Occasional Contributor
Posts: 7

Re: Extracting the Count based on Conditions

I have attached the file for the data ( Sheet - DATA)

So, Form base data, I wanted to extract the Customers.

Super User
Posts: 10,035

Re: Extracting the Count based on Conditions

What is your rules? How can you get RESULT REQUIRE from BASE DATA ? Where is EMP NAME coming from ? BASE DATA don't have it .
Super User
Posts: 7,804

Re: Extracting the Count based on Conditions

Please supply your example data in a data step with cards;

I won't open a MS Office file from the web because of security considerations. I guess the same goes for most contributors here.

---------------------------------------------------------------------------------------------
Maxims of Maximally Efficient SAS Programmers
Occasional Contributor
Posts: 7

Re: Extracting the Count based on Conditions

Posted in reply to KurtBremser
 RESULT REQUIRED         
 CATEGORY OF CUSTOMER    BASE DATA  
EMP ABCD    CATEGORYCOUNT OF TOTAL CUSTOMERS  
127301829    A8000  
221181721    B12000  
310181028    C9000  
413242417    D11000  
523121829        
613291326  
 
   
 
 
727112318   
816162716   
925132027   
1013262528   
1124121429   
1212202522   
1314122426   
1428222027   
1530273013   
1612251821   
1713131517        
1817181428        
1911251220        
             
             
Ask a Question
Discussion stats
  • 7 replies
  • 1049 views
  • 0 likes
  • 3 in conversation