How to get specific year members

Accepted Solution Solved
Reply
Contributor
Posts: 49
Accepted Solution

How to get specific year members

Hi All,

I have a large data and I would like to split into two parts, one will be for the people who were active in 12 months and another will be the people who were not active. So if the member has 12 months = active if not member is inactive. I would like to add another column indicating active, inactive Here's an example of my data. Any help is appreciated.

ID#

MONTH

12

January 1, 2011

12

February 1, 2011

12

March 1, 2011

12

April 1, 2011

12

May 1, 2011

12

June 1, 2011

12

July 1, 2011

12

August 1, 2011

12

September 1, 2011

12

October 1, 2011

12

November 1, 2011

12

December 1, 2011

13

January 1, 2011

13

February 1, 2011

13

March 1, 2011

13

April 1, 2011

14

March 1, 2011

14

April 1, 2011

14

May 1, 2011

14

June 1, 2011


Accepted Solutions
Solution
‎02-06-2013 11:26 AM
Super User
Posts: 19,782

Re: How to get specific year members

Does your data only have the 12 months you care about in it? are there unique entries?

If not you can just count how many times a member is present.

proc sql;

create table want as

select id, month, case when count(id) =12 then 'Active' else 'Inactive' end as status

from have

group by id;

quit;

View solution in original post


All Replies
Solution
‎02-06-2013 11:26 AM
Super User
Posts: 19,782

Re: How to get specific year members

Does your data only have the 12 months you care about in it? are there unique entries?

If not you can just count how many times a member is present.

proc sql;

create table want as

select id, month, case when count(id) =12 then 'Active' else 'Inactive' end as status

from have

group by id;

quit;

Contributor
Posts: 49

Re: How to get specific year members

Thanks Reeza that was great help. I did a little tweak and worked. Again thanks all :-)

🔒 This topic is solved and locked.

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

Discussion stats
  • 2 replies
  • 168 views
  • 1 like
  • 2 in conversation