Hi itshere, I have make a simple try below assuming different type of car purchased per month. If you could provide more information about uniqueness, I may try to refine it further. data test1;
format date datetime21.;
input type $ date datetime21. ;
cards;
a 01OCT2015:15:22:22
b 3OCT2015:15:22:22
a 11OCT2015:15:22:22
b 13OCT2015:15:22:22
c 11OCT2015:15:22:22
b 30OCT2015:15:22:22
a 01NOV2015:15:22:22
a 02NOV2015:15:22:22
b 03NOV2015:15:22:22
a 01MAR2015:15:22:22
b 02MAR2015:15:22:22
c 03MAR2015:15:22:22
;
run;
data test2;
set test1;
month=put(datepart(date),worddatx9.);
run;
proc sql;
create table test3 as
select month, type,count(type) as num_of_car_per_month
from test2
group by month, type
;
quit;
... View more