PerlIsGood
Programmer
I'm trying to summarize data that look like this:
I've been trying to summarize this data, summarizing all financial fields between classes (CLS * PCT_LVL) including a grand total at the end of the summary. Right now I'm only getting sums and percentages across PCT_LVL broken out by CLS, which is close but not quite what I need.
This is what I've been using, but I'm not getting what I need. What am I missing?
Notorious P.I.G.
Code:
Example Data
CLS PCT_LVL VARS1-VARSx
1 A x
1 B x
1 C x
2 A x
2 B x
3 C x
I've been trying to summarize this data, summarizing all financial fields between classes (CLS * PCT_LVL) including a grand total at the end of the summary. Right now I'm only getting sums and percentages across PCT_LVL broken out by CLS, which is close but not quite what I need.
Code:
Example Output:
CLS PCT_LVL CNT %
1 A 50 50%
1 B 5 5%
1 C 45 45%
Etc. for each CLS
This is what I've been using, but I'm not getting what I need. What am I missing?
Code:
PROC TABULATE data = rbp_3i_for_Table FORMAT=10.0;
class CLS PCT_LVL_CD app_month;
var rbp_3i_number_apps
rbp_3i_number_approval
rbp_3i_number_decline
rbp_3i_number_cancel
rbp_3i_number_pending
rbp_3i_number_decisions;
table (cls='Class' * PCT_LVL_CD ='PCT_LVL_CD' all='Total' * [style=[font_weight=bold]])
* (SUM='Number' * (rbp_3i_number_approval='Approved'
rbp_3i_number_decline='Declined'
rbp_3i_number_cancel='Cancelled'
rbp_3i_number_pending = 'Pending'
rbp_3i_number_apps='Total')
PCTN<rbp_3i_number_decisions>='Percentage' * FORMAT=pc. * (rbp_3i_number_approval='Approved' rbp_3i_number_decline='Declined'
rbp_3i_number_cancel='Cancelled')),
(app_month='Month' all='Total' * [style=[font_weight=bold]])
/ BOX = 'Criteria : xxx';
title 'TITLE';
run;
Notorious P.I.G.