Hello
I want to use proc report to display a summary table.
My question is how to merge cels with same Cat2 value into one cell?
It is important to keep the order of the rows same as in the summary table .
Data summaryinfo;
input Cat $ Cat2 $ reduce Customers;
cards;
e group1 -500 200
b group1 -300 300
Total group1 -800 500
c group2 -250 400
a group2 -200 100
d group2 -100 150
Total group2 -550 650
;
run;
proc report data=summaryinfo nowd
style(header)={background=lightgrey};
column Cat Cat2 reduce Customers;
Define Cat /display;
Define Cat2 /display;
Define reduce /display;
Define Customers /display;
Run;
Hi @Ronein
Does the "GROUP" and 'SPANROWS' option meet your expectations?
proc report data=summaryinfo nowd spanrows style(header)={background=lightgrey};
column Cat Cat2 reduce Customers;
Define Cat /display;
Define Cat2 /group style(column)={vjust=m just=l};
Define reduce /display;
Define Customers /display;
Run;
April 27 – 30 | Gaylord Texan | Grapevine, Texas
Walk in ready to learn. Walk out ready to deliver. This is the data and AI conference you can't afford to miss.
Register now and lock in 2025 pricing—just $495!
Still thinking about your presentation idea? The submission deadline has been extended to Friday, Nov. 14, at 11:59 p.m. ET.
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.
Ready to level-up your skills? Choose your own adventure.