BookmarkSubscribeRSS Feed
☑ This topic is solved. Need further help from the community? Please sign in and ask a new question.
Sandeep77
Lapis Lazuli | Level 10

Hello Experts,

I have a dataset which has month and three results in other column i.e., Pos, Neg and New. I want to find Pos, Neg and New result types in each month but I am not sure what is the correct way to approach this query. I can use case when to get results count monthly but I want count of different results in each month. Can you please help? Below is a sample data:

Month Acc_number Result
Other 10057292 POS
Apr-22 105181382 NEG
May-22 105464549 NEW
Jun-22 106517071 NEG
Other 107891210 NEG
Dec-22 112634274 POS
Feb-22 113570766 POS
1 ACCEPTED SOLUTION

Accepted Solutions
PaigeMiller
Diamond | Level 26
proc freq data=have;
    tables month*result;
run;

 

 

Also, please provide data as working SAS data step code. I shouldn't have to ask repeatedly for this. https://communities.sas.com/t5/New-SAS-User/I-am-trying-to-find-accounts-looping-in-again-in-the-sam... 

--
Paige Miller

View solution in original post

2 REPLIES 2
PaigeMiller
Diamond | Level 26
proc freq data=have;
    tables month*result;
run;

 

 

Also, please provide data as working SAS data step code. I shouldn't have to ask repeatedly for this. https://communities.sas.com/t5/New-SAS-User/I-am-trying-to-find-accounts-looping-in-again-in-the-sam... 

--
Paige Miller
Sandeep77
Lapis Lazuli | Level 10

Thank you!! It worked. I never used * before. So this was a new learning. Thanks again!