Hello Kdang,
Try the following code, where b is the data set containing id signupdate logindate activity:
/* Add Login Month */;
data r;
set b;
lm=MONTH(logindate);
run;
/* Count Start and Open Activities */;
proc SQL;
create table rr as
select id, lm, activity, Count(*) as n
from r
group by id, lm, activity
;quit;
/* Count Login Activities */;
proc SQL;
create table login as
select id, lm, "login" as activity , sum(n) as n
from rr
group by id, lm
;quit;
/* Combine results */;
data rrr;
set rr login;
run;
proc sort data=rrr;
by id lm activity;
run;
Sincerely,
SPR
... View more