BookmarkSubscribeRSS Feed
Konkordanz
Pyrite | Level 9

Hi,

 

I tried several options but it doesnt work for me. What I want: A hole row shall be bold, if one column has a specific value.

For example with the sashelp.cars-data: I want to have a bold row, if the Make-Value is "Kia".

Thank you for help!

 

 

proc tabulate data=sashelp.cars;
class make type;
var msrp;
table make,type*msrp;
run;
3 REPLIES 3
Ksharp
Super User

Use PROC REPORT instead.

 

proc report data=sashelp.cars nowd;
columns make msrp,type;
define make/group style=header;
define type/across;
define msrp/analysis sum  ' ';
compute make;
 if make='Kia' then do;
  call define(_row_,'style','style={fontweight=bold}');
  call define(_col_,'style','style=header');
 end;
endcomp;
run;

Ksharp_0-1667304907716.png

 

Konkordanz
Pyrite | Level 9

Right, with proc-report its doable. But is there also a solution for the proc-tabulate-step?

Ksharp
Super User

OK. It is not easy for PROC TABULATE.

But how about this one ?

 

proc format;
value $ fmt
'Kia'='bold'
other='light'
;
run;

proc tabulate data=sashelp.cars;
class make type;
classlev make/style={fontweight=$fmt.};
var msrp;
table make*{style=<parent>{background=white foreground=black}},type*msrp;
run;

Ksharp_0-1667389287466.png

 

Ready to join fellow brilliant minds for the SAS Hackathon?

Build your skills. Make connections. Enjoy creative freedom. Maybe change the world. Registration is now open through August 30th. Visit the SAS Hackathon homepage.

Register today!
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
  • 3 replies
  • 466 views
  • 1 like
  • 2 in conversation