PROC REPORT DATA=expo.OPEN_TICKET_SUMMARY_SOURCE1 out=expo.summary_table_result LIST
/*style=[cellwidth=.1 in rules=group frame=void] */
style(header)=[background= #BBDEFB foreground=black]
style(summary)=[background=white foreground=black font_weight=bold];
COLUMN UserName (category,status) Total_count ;
DEFINE UserName / GROUP style=[background=#BBDEFB foreground=black font_weight=bold borderleftwidth=2 borderrightwidth=2] ;
DEFINE CATEGORY / ACROSS style =[borderleftwidth=1 borderrightwidth=1];
DEFINE STATUS / ACROSS style =[borderleftwidth=1 borderrightwidth=1 ];
define total_count / computed style=[font_weight=bold foreground=black ] ;
rbreak after / summarize;
compute total_count;
Total_count=sum(input(_c2_,best32.),
input(_c3_,best32.),
input(_c4_,best32.),
input(_c5_,best32.),
input(_c6_,best32.),
input(_c7_,best32.),
input(_c8_,best32.),
input(_c9_,best32.),
input(_c10_,best32.)
);
IF total_count ^= ''
THEN CALL DEFINE(_COL_, "style", "STYLE=[BACKGROUND=white ]");
endcomp;
RUN;
Why not summarise your data in a a datastep before the proce report using a procedure designed for such a task - means/summary - then use a simple proc report to print the data out. You have full control over the data then.
As I understand proc report you can only modify the order of appearance of variables that are Group, Order or Across, not computed.
So to get the desired order I think you'll want to go with @RW9's suggestion of summarizing the data prior to building the report.
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.