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.

SAS Innovate 2025: Register Now

Registration is now open for SAS Innovate 2025 , our biggest and most exciting global event of the year! Join us in Orlando, FL, May 6-9.
Sign up by Dec. 31 to get the 2024 rate of just $495.
Register now!

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
  • 477 views
  • 0 likes
  • 2 in conversation