BookmarkSubscribeRSS Feed
🔒 This topic is solved and locked. Need further help from the community? Please sign in and ask a new question.
d0816
Quartz | Level 8

HI,

I have following dataset where I want to do a unduplicated count of ID if During or After is a "yes". With this logic unduplicated ID count that satisfy this condition is 8. would appreciate any help. Thanks.

 

IDDuringAfter
1 Yes
2 Yes
2 Yes
2 Yes
2 Yes
3  
3 Yes
3  
3 Yes
4  
4 Yes
4Yes 
4Yes 
5  
6 Yes
7  
8Yes 
8Yes 
9  
9 Yes
9 Yes
10  
10  
11Yes 
12  
1 ACCEPTED SOLUTION

Accepted Solutions
PaigeMiller
Diamond | Level 26
proc sql;
    select count(distinct id) from have where during="Yes" or after="Yes";
quit;
--
Paige Miller

View solution in original post

2 REPLIES 2
PaigeMiller
Diamond | Level 26
proc sql;
    select count(distinct id) from have where during="Yes" or after="Yes";
quit;
--
Paige Miller
d0816
Quartz | Level 8

Thank  you Paige.

Ready to join fellow brilliant minds for the SAS Hackathon?

Build your skills. Make connections. Enjoy creative freedom. Maybe change the world. Registration is now open through August 30th. Visit the SAS Hackathon homepage.

Register today!
Mastering the WHERE Clause in PROC SQL

SAS' Charu Shankar shares her PROC SQL expertise by showing you how to master the WHERE clause using real winter weather data.

Find more tutorials on the SAS Users YouTube channel.

Discussion stats
  • 2 replies
  • 378 views
  • 0 likes
  • 2 in conversation