This looks like the kind of report that could easily be accomplished with a PROC TABULATE or a PROC REPORT. The trick will be to extract the date portion from your DATETIME variable and then either format the date portion to only show the month or the month and year or to extract just the month from the date portion. The statistic for a count of observations is the N statistic (N is how you get a COUNT and PCTN is the percent of the COUNT). The universal CLASS variable ALL will be how you get the final total (what you show as the FREQ) column.
You could probably summarize the data with PROC MEANS or PROC SQL, too, but there's no need to make 2 passes through the data after you read it, when TABULATE or REPORT would generate the report with 1 pass through the data.
sum(case when intnx('month',datepart(dt),0,begin)='01Nov2010' then 1 else 0 end) as Nov,
sum(case when intnx('month',datepart(dt),0,begin)='01Dec2010' then 1 else 0 end) as Dec,
count(*) as Total_Calls
group by Name, cardno;
Explanation: 1st observation is counted as it is the first call. 2nd, 3rd, 4th obs not counted as they are all within 30 mins of first call. Obs 5 is counted as it exceeds 30 mins when compared to 1st obs. Obs6 also counted as it exceeds 30 mins when compared to obs 5.
Again i need to know how many times EACH customer calls and how many times they call PER MONTH but with the new condition.
Need all the help i can get. Thanks.
Message was edited by: Zoey Elle