Hi SAS Experts,
I noticed that the the proc report sums the percentages on the breake. Which does not make sense in my case.
How can I "re"-calculate the percentages for the break/totals e.g. BIGORG_CODE?
proc report data=DATASELECT_BIGORG;
COLUMN BIGORG_CODE BIGORG_MATRIX MATRIX_GROUP_TEXT
('Source'
('COUNTRYX'(
('' COUNT_COUNTRYX)
('' RHG_COUNTRYX) )
('' RHG_COUNTRYX_PERCENT)
('' RHGBEANSTAN_COUNTRYX)
('' RHGBEANSTAN_COUNTRYX_PERCENT))
);
DEFINE BIGORG_CODE / GROUP 'Code';
DEFINE MATRIX_GROUP_TEXT / 'Main Group';
DEFINE BIGORG_MATRIX / 'Matrix';
DEFINE COUNT_COUNTRYX / 'n';
DEFINE RHG_COUNTRYX / '>RHG';
DEFINE RHG_COUNTRYX_PERCENT / '%' format=nlnum20.1;
BREAK AFTER BIGORG_CODE / summarize style=[backgroundcolor=#C8CCA8 fontsize=1 fontfamily=arial];
/*coloring*/
COMPUTE RHG_COUNTRYX_PERCENT;
IF RHG_COUNTRYX_PERCENT.SUM > 1 AND RHG_COUNTRYX_PERCENT.SUM ne . THEN call define(_col_,"style","style={background=#2F75B5 foreground=white fontsize=1}");
ENDCOMP;
run;
Since you don't define a statistic in your DEFINE statements report is using the default SUM for the varaibles. Since Proc Report isn't calculating the percents but just lisint values you provided, it can't calculate a summary percent (at least not without a fair amount of work on your part for coding the summary).
Don't miss out on SAS Innovate - Register now for the FREE Livestream!
Can't make it to Vegas? No problem! Watch our general sessions LIVE or on-demand starting April 17th. Hear from SAS execs, best-selling author Adam Grant, Hot Ones host Sean Evans, top tech journalist Kara Swisher, AI expert Cassie Kozyrkov, and the mind-blowing dance crew iLuminate! Plus, get access to over 20 breakout sessions.
Learn how use the CAT functions in SAS to join values from multiple variables into a single value.
Find more tutorials on the SAS Users YouTube channel.