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;
Are you ready for the spotlight? We're accepting content ideas for SAS Innovate 2025 to be held May 6-9 in Orlando, FL. The call is open until September 25. Read more here about why you should contribute and what is in it for you!
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.