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;
Registration is now open for SAS Innovate 2025 , our biggest and most exciting global event of the year! Join us in Orlando, FL, May 6-9.
Sign up by Dec. 31 to get the 2024 rate of just $495.
Register now!
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.