Perfect! Thanks! Last question: how would you suggest I incorporate the two programs (yours and the one which sums the clicks since drop_date and beginDate will be the same in some situations? drop_date URL Creative_Name BeginDate 20-May-13 Link.com/east/2es Perf Offer 20-May-13 7-Mar-13 Link.com/north/2gq Bonuse Power 7-Mar-13 31-Jan-13 Link.com/south/2ke Offer Box 31-Jan-13 12-Aug-13 Link.com/south/2ke Sign Up Now 31-Jan-13 30-Sep-13 Link.com/west/2ev We Want Bonuses 30-Sep-13 data Creative_Drops_new; set Creative_Drops; by URL Creative_Name; if first.URL then do; BeginDate=.; if first.Creative_Name then do; if Drop_Date ne . then BeginDate=Drop_Date; if last.URL then do; if last.Creative_Name then do; retain BeginDate; format BeginDate date9.; end; end; end; end; run; proc sql; create table analyze as select a.*, b.ResponseDate,b.clicks from Creative_Drops as a left join URL_Responses as b on b.ResponseDate ge a.drop_date and a.url=b.url; create table result as select drop_date, URL, Creative_Name, sum(clicks) as Total_Clicks from analyze group by drop_date, URL, Creative_Name ; quit;
... View more