Adding Harvey Balls to your SAS reports

I'm currently working on a large project for a SAS customer. The project comprises many activities and phases, so there is a need to track progress on many different levels. During a recent meeting the project manager announced, "I'm putting together a status deck, and I'll include some Harvey Balls for each item."

"Harvey whats?" I said, nearly spitting out my coffee.

I've since learned that Harvey Balls are a project-management thing. They are used as a way to communicate qualitative progress towards a goal: not just whether an item is complete, but also how far along it is. (Please, don't confuse these with Harvey wallbangers, which are used to measure progress towards something else.) Harvey Balls remind me of the little circles that I see in Consumer Reports product reviews.

A web search will yield lots of examples of how to add Harvey Balls to your PowerPoint slides and Excel spreadsheets -- favorite domains of project managers. However, there isn't much (any?) about how to use these in SAS, so with this blog post I hope to corner the market.

First, a visual -- here's what Harvey Balls look like in a SAS report:

It turns out that the Harvey Ball glyphs are built into some of the fonts that you probably have installed, and can be accessed by referencing their Unicode character values. For ODS-based reports, we can include any Unicode character that we need by using:

the ODS escape character, combined WITH...

the {unicode} keyword, AND..

the hexadecimal code of the character we want.

For example:

ods escapechar='~';
title "This is a full-circle Harvey Ball: ~{unicode '25CF'x}";

yields this:

For a more data-driven approach, I decided to encode the Harvey Balls in a numeric SAS format. In my mapping, I set values between 0 and 4, inclusive. 0 means "empty" or no progress, whereas 4 means "full" or complete. 1 through 3 represent a quarter, halfway, and three-quarters, respectively.

ods escapechar='~';
proc format lib=work;
value hb
0 = "~{unicode '25CB'x}" /* empty circle */
1 = "~{unicode '25D4'x}" /* quarter */
2 = "~{unicode '25D1'x}" /* half */
3 = "~{unicode '25D5'x}" /* three-quarter */
4 = "~{unicode '25CF'x}" /* full */
;

Here's a partial listing of the PROC REPORT code that uses the format. Note that I added some other appearance treatments to the report column with the Harvey Ball. Because the font glyph tends to be small, I bumped up the font size to 18 points. I also specified Lucida Sans Unicode as the font face because I know that font contains the right glyphs. Finally, I tweaked the alignments to account for the larger padding that accompanies the larger font size, ensuring the data looked vertically aligned properly in each row.

proc report data=progress;
columns stage dev test prod;
define stage / 'Activity' display style=[verticalalign=center];
define dev / '% Dev' format=hb.
style(column)=[
font_face='Lucida Sans Unicode'
font_size=18pt
verticalalign=center
just=c
color=blue
];
/* ... */

>> Download the complete example program from here. (Should work with SAS 9.2 or later)

Bonus: If you have SAS 9.4, you can modify this program to place the report directly into PowerPoint! This makes it perfect for consumption by project managers everywhere.

ods powerpoint file="c:\temp\hb.pptx" style=PowerPointLight;
/* proc report section here...*/
ods powerpoint close;

Here's a screenshot of the result (click to see it full size):

See also

The Power of Unicode (using these characters in SG plots)
Unicode Tick Values using GTL
The Great Escape(char) - great paper by SAS user Louise S. Hadden