Hi All, I'm trying to use Proc Tabulate to create a table for me. I need to use two fields from the data to calculate the Average Speed of Answer. Total_Answer_TM / Calls_Answered_CNT = ASA. Sample of Data WEEK_END_DT EVENT_DT MBL CLUSTER CALLS_ANSWERED_CNT TOTAL_ANSWER_TM ASA 4/12/2016 28/11/2016 MBL DSC 7530 12321475 27:16 4/12/2016 28/11/2016 MBL EMS 7969 14496946 30:19 4/12/2016 28/11/2016 MBL DFAP 21769 20910688 16:01 4/12/2016 28/11/2016 MBL OA 5217 6588138 21:03 4/12/2016 28/11/2016 MBL PST 3360 9125172 45:16 4/12/2016 28/11/2016 MBL YAS 4724 9069548 32:00 4/12/2016 28/11/2016 Oth ABS 618 594013 16:01 4/12/2016 28/11/2016 Oth CMC 3719 3004070 13:28 4/12/2016 28/11/2016 Oth CCP 18 3183 02:57 The above allows me to get the columns right but how do I get the row and Column total to be claculated out to show the right answer. Can I do the calculations in the Proc tabulate and not show the Total_Answer_TM and Calls_Answered_CNT fileds in the ouput? and not have to do the proc summary and new data step? Data Report.SSW_ASA;
Set Cartel.preagent_telephony;
Keep Week_end_dt EVENT_DT PROGRAMME_NM CLUSTER CALLS_ANSWERED_CNT TOTAL_ANSWER_TM MBL
;
Where week_end_dt = '04Dec2016.'d
and CALL_TYPE = 'External'
and PROGRAMME_NM IN ("SSW");
IF Cluster_ID in ('1' , '6', '9', '13', '18', '27') and Queue_Type IN (CHOPS', 'PST') THEN
MBL = 'MBL';
ELSE MBL = 'Other';
Run;
Proc Sort data=Report.SSW_ASA;
By Week_end_dt EVENT_DT PROGRAMME_NM MBL CLUSTER;
Run;
Proc Summary data=Report.SSW_ASA SUM NOPRINT;
by Week_end_dt EVENT_DT PROGRAMME_NM MBL CLUSTER;
VAR CALLS_ANSWERED_CNT TOTAL_ANSWER_TM;
Output out=Report.SSW_ASA_SUM (DROP=_TYPE_ _FREQ_) SUM=;
Run;
Data Work.SSW_ASA_2;
Set Work.SSW_ASA_SUM;
ASA = (TOTAL_ANSWER_TM/CALLS_ANSWERED_CNT);
Format ASA mmss.;
Run;
proc tabulate data=Work.SSW_ASA_2 format=mmss.;
class event_dt MBL cluster;
var ASA;
table
MBL*cluster=" " All = "Daily Totals"
, event_dt=" "*ASA=" " All="Weekly Total"*ASA=" "
/ box="Cluster"
;
keylabel sum= " ";
Title "Average Speed of Answer";
run; Output Cluster 2016-11-28 2016-11-29 2016-11-30 2016-12-01 2016-12-02 2016-12-03 2016-12-04 Weekly Total MBL 27:16:00 28:03:00 24:58:00 29:14:00 32:51:00 . . 142 MBL DSC EMS 30:19:00 30:04:00 27:29:00 31:18:00 36:31:00 0:01 . 155 FAP 16:01 13:21 13:20 14:42 20:05 . . 77:29:00 OA 21:03 18:13 17:30 22:08 27:06:00 . . 106 PST 45:16:00 28:29:00 30:38:00 45:03:00 55:43:00 . . 205 YAS 32:00:00 31:22:00 25:58:00 35:25:00 42:25:00 . . 167 Oth Abs 16:01 15:19 15:20 18:57 29:31:00 . . 95:09:00 CMC 13:28 10:40 10:05 10:12 17:02 . . 61:26:00 CCP 2:57 2:10 1:14 2:24 1:29 . . 10:15 DHS 4:15 3:16 2:00 4:45 5:57 . . 20:14 Daily Totals 382 295 262 334 436 4:27 6:29 1721 Some of these calculations are out do to being exported out to excel. Cheers
... View more