BookmarkSubscribeRSS Feed
Amber1331
Calcite | Level 5

Using the below code I created the attached table (for simplicity I deleted the majority of the columns). I am trying to create a conditional format where if the number in the district row, AL column (first number) is greater than the number in the national row, AL column (second number) then the district number will be bold. The example illustrates what i am trying to achieve.  I have been trying to use call define to achieve this formatting, but to no avail. Any tips would be greatly appreciated. 

 

proc report data=math_domain_prof nowd spanrows
style(report)=[cellspacing=0pt cellpadding=0pt fontsize=11pt bordercolor=CX4BACC6];
where grade in (0:8);
column student_Grade_level_id D_N al geo ms no;
define student_Grade_level_id/ order order=DATA flow 'Grade' style={vjust=center BACKGROUND=white fontfamily=Calibri fontsize=7pt just=center borderrightcolor=white borderbottomcolor=CX4BACC6 bordertopcolor=CX4BACC6 borderleftcolor=CX4BACC6 height=.05in
cellspacing=0 cellpadding=0}
style(header)=[background=CX4BACC6 font_weight=bold foreground=white JUST=center vjust=center fontfamily=Calibri fontsize=8pt width=8%
borderrightcolor=white borderbottomcolor=CX4BACC6 bordertopcolor=CX4BACC6 borderleftcolor=CX4BACC6 height=.10in];
define D_N / 'District/National' group order=DATA flow style={BACKGROUND=white fontfamily=Calibri fontsize=7pt just=center borderrightcolor=white borderbottomcolor=CX4BACC6 bordertopcolor=CX4BACC6 borderleftcolor=white height=.05in
cellspacing=0 cellpadding=0}
style(header)=[background=CX4BACC6 font_weight=bold foreground=white JUST=center vjust=center fontfamily=Calibri fontsize=8pt width=8%
borderrightcolor=white borderbottomcolor=CX4BACC6 bordertopcolor=CX4BACC6 borderleftcolor=white height=.10in];
define albold / group noprint;
define al /'Algebra and Algebraic Thinking' group flow style={JUST=center fontfamily=Calibri fontsize=7pt borderrightcolor=white borderbottomcolor=CX4BACC6 bordertopcolor=CX4BACC6 borderleftcolor=white height=.05in
cellspacing=0 cellpadding=0}
style(header)=[BACKGROUND=CX4BACC6 font_weight=bold foreground=white just=center fontfamily=Calibri fontsize=8pt width=15%
borderrightcolor=white borderbottomcolor=CX4BACC6 bordertopcolor=CX4BACC6 borderleftcolor=white height=.10in vjust=center];
define no/ 'Numbers and Operations' flow style={JUST=center fontfamily=Calibri fontsize=7pt borderrightcolor=CX4BACC6 borderbottomcolor=CX4BACC6 bordertopcolor=CX4BACC6 borderleftcolor=white height=.05in
cellspacing=0 cellpadding=0}
style(header)=[BACKGROUND=CX4BACC6 font_weight=bold foreground=white just=center fontfamily=Calibri fontsize=8pt width=15%
borderrightcolor=CX4BACC6 borderbottomcolor=CX4BACC6 bordertopcolor=CX4BACC6 borderleftcolor=white height=.10in vjust=center];
define geo/ 'Geometry' flow style={JUST=center fontfamily=Calibri fontsize=7pt borderrightcolor=white borderbottomcolor=CX4BACC6 bordertopcolor=CX4BACC6 borderleftcolor=white height=.05in
cellspacing=0 cellpadding=0}
style(header)=[BACKGROUND=CX4BACC6 font_weight=bold foreground=white just=center fontfamily=Calibri fontsize=8pt width=15%
borderrightcolor=white borderbottomcolor=CX4BACC6 bordertopcolor=CX4BACC6 borderleftcolor=white height=.10in vjust=center];
define ms / 'Measurement and Data' flow style={JUST=center fontfamily=Calibri fontsize=7pt borderrightcolor=white borderbottomcolor=CX4BACC6 bordertopcolor=CX4BACC6 borderleftcolor=white height=.05in
cellspacing=0 cellpadding=0}
style(header)=[BACKGROUND=CX4BACC6 font_weight=bold foreground=white fontfamily=Calibri fontsize=9pt width=15%
borderrightcolor=white borderbottomcolor=CX4BACC6 bordertopcolor=CX4BACC6 borderleftcolor=white height=.10in vjust=center];
compute after student_Grade_level_id / style={borderbottomwidth=3pt};
endcomp;
run;

 

 

2 REPLIES 2
Reeza
Super User
Can you please paste the code into a code object in the question, it looks like a piece of paper in the editor options. It's hard to read as is, and I think parts may have been truncated out as I see some defines with no CALL infront of it. Ideally, if you could simplify the question and include only the section of interest that would work too.
Amber1331
Calcite | Level 5

My apologies. Please see below. I have simplified the code by removing all of of the styles. My main goal is to create a conditional format on columns, al, no, geo, and ms. The table is currently set up to show a district percent and national percent by grade (please see attached picture in the original question). If the district percent is greater than the national percent, then I want to have that percent be bold. I could use proc format and create a long list of formats, but I was trying to find a quicker way around. Does that make more sense?

proc report data=math_domain_prof nowd spanrows
style(report)=[cellspacing=0pt cellpadding=0pt fontsize=11pt bordercolor=CX4BACC6];
where grade in (0:8);
column student_Grade_level_id D_N al geo ms no;
define student_Grade_level_id/ order order=DATA flow 'Grade';
define D_N / 'District/National' group order=DATA flow;
define al /'Algebra and Algebraic Thinking' flow;
define no/ 'Numbers and Operations' flow;
define geo/ 'Geometry' flow;
define ms / 'Measurement and Data' flow;
compute after student_Grade_level_id / style={borderbottomwidth=3pt};
endcomp;
run;

sas-innovate-2024.png

Join us for SAS Innovate April 16-19 at the Aria in Las Vegas. Bring the team and save big with our group pricing for a limited time only.

Pre-conference courses and tutorials are filling up fast and are always a sellout. Register today to reserve your seat.

 

Register now!

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
  • 2 replies
  • 1330 views
  • 0 likes
  • 2 in conversation