I have created a summary table of several different variables from a table and created columns to look at the number of instances occurring in each year. The table also provides a ColPctN for the two years separately (see attached).
I'd like to create conditional formatting based on the following:
1. If the ColPctN for a variable value is 10% or less in YEAR2 turn the cell red
2. If the ColPctN for a variable value is 10% or greater in YEAR2 turn the cell green
Is there a way I can use conditional formatting or something else to make this adjustment in the summary table output.
Thanks,
runningjay
Hi:
With PROC TABULATE, you can use a format to do some highlighting, such as shown below:
However, this format applies to both columns for COLPCTN. Not just the M column. It happened to work because I hardcoded 10.00 and 30.00 which were only found in the M column.
With different values in the format, my format would impact both columns, like this:
The only way to JUST touch one of the cell values in the M column without impacting the F column would be to switch to PROC REPORT or possibly the Report Writing Interface. But for calculating COLPCTN, you might want to use TABULATE to generate the values and then use REPORT for the color coding. Your logic is not entirely clear to me for the color coding your want.
Hope this helps,
Cynthia
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 16. Read more here about why you should contribute and what is in it for you!
What’s the difference between SAS Enterprise Guide and SAS Studio? How are they similar? Just ask SAS’ Danny Modlin.
Find more tutorials on the SAS Users YouTube channel.
Select SAS Training centers are offering in-person courses. View upcoming courses for: