BookmarkSubscribeRSS Feed
Ronein
Meteorite | Level 14

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;
1 REPLY 1
ed_sas_member
Meteorite | Level 14

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;

 Capture d’écran 2020-03-11 à 10.32.51.png

SAS Innovate 2025: Call for Content

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!

Submit your idea!

How to Concatenate Values

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.

Click image to register for webinarClick image to register for webinar

Classroom Training Available!

Select SAS Training centers are offering in-person courses. View upcoming courses for:

View all other training opportunities.

Discussion stats
  • 1 reply
  • 348 views
  • 1 like
  • 2 in conversation