DATA Step, Macro, Functions and more

Proc SQL - Column labels

Accepted Solution Solved
Reply
Contributor
Posts: 60
Accepted Solution

Proc SQL - Column labels

Hi everyone,

 

I'm looking for unique counts by a certain group. So when I use this code:

 

 

proc sql;
select count(distinct(childid)) as UniqueFam
from ResearchAsthmaEvent5
where programtypeid = 1 
group by casedisposition_coll;
run; 

I get this results:

 

UniqueFam
130
56
11

 

What I would like is this:

 

casedisposition_collUniqueFam
1130
256
3

11

 

Thanks in advance!


Accepted Solutions
Solution
‎03-19-2018 10:15 AM
Contributor
Posts: 60

Re: Proc SQL - Column labels

Doh!, I figured it out! 

 

proc sql;
select casedisposition_coll, count(distinct(childid)) as UniqueFam
from ResearchAsthmaEvent5
where programtypeid = 1 
group by casedisposition_coll;
run; 

View solution in original post


All Replies
Solution
‎03-19-2018 10:15 AM
Contributor
Posts: 60

Re: Proc SQL - Column labels

Doh!, I figured it out! 

 

proc sql;
select casedisposition_coll, count(distinct(childid)) as UniqueFam
from ResearchAsthmaEvent5
where programtypeid = 1 
group by casedisposition_coll;
run; 
☑ This topic is solved.

Need further help from the community? Please ask a new question.

Discussion stats
  • 1 reply
  • 79 views
  • 0 likes
  • 1 in conversation