I have this code using the across and analysis functions. I want to add 1 column on the far right side which has the row totals going across, including those for the computed Totals. If you are wondering about the single letter coding, I used those to re-word some values and found letters to be easier to manage while assigning the visible text in Proc Format. No numbers because numeric format interfered with the Total labels. If I have to change something, then I know exactly where to go.
proc report data=TEAM_SUMMARY nowd ;
columns Team Activity Month, cnt ;
define Team/ group order=data;
define Activity/group "Activity" format=$Acty. order=internal;
define Month/across "Month in Play" order=data f=$Month.;
define cnt/analysis "" f=comma18.0;
compute Activity;
if Activity= 'J' then do;
call define(_row_, "style", "style=[foreground=Red]");
end;
if Activity = 'K' then do;
call define(_row_, "style", "style=[foreground=Green]");
end;
endcomp;
break after Team/summarize style=[foreground=black just=r font_weight=bold];
rbreak after /summarize style=Header[background=lightgreen just=c];
compute before Team/style=[background=light grey];
line ' ';
endcomp;
compute after Team;
Activity = 'Team Total';
endcomp;
compute after;
Activity = 'Grand Total';
endcomp;
run;
... View more