BI Tools

Tips and tricks for building information maps, OLAP cubes, reports, and dashboards

BI Admin

Learn your way around a SAS BI installation.

Visual Analytics

Learn your way around the SAS Visual Analytics tool

Coding & Data

Extract, transform, and load your data into the SAS BI toolset

Stored Processes

Create and design stored processes like a rock star

Home » BI Tools

Web Report Studio: Adding Dashboard Indicators with a SAS Stored Process

Submitted by on 2011-11-14 – 7:50 AM 11 Comments

Sometimes SAS Web Report Studio needs some dashboard dials and sliders that seems like mission impossible for you. However, add a SAS stored process with the trusty ole’ SAS GKPI procedure to bring the dashboard features to your local report. I know you are wondering – “What is this special magical procedure of which she speaks?” Oh you are about to find out my precious little SAS geeks.

Adding Dashboard Goodies to SAS Web Report Studio

You can easily add sliders, dials, and speedometers to your report using a stored process and the SAS GKPI procedure. In the following figure, the report has a sample of the different gadgets you can add.  Plus notice – there is not any data (cube, info map) being used – it’s all stored processes.  

Web Report Studio Dashboard

 Show me the Code!

 Web Report Studio Dashboard Speedometer

All of the code was based on the examples from the GKPI procedure SAS documentation.  I’m only going to show how to create the one for the Avg Fix Response Time because there are just a few fine points to creating an registering the stored process. Otherwise, I basically used the examples from the SAS documentation and I think it’s easy enough to figure out.

 

 

Creating the SAS Stored Process Code

 Code Info 
 /*==== Start Code ==== */

 %let YOUR_PCT=.72;

 

Your code to set the value would be here – I have used a percentage for my speedometer. For this example I am just hard-coding it so you can understand how this works.  

You can also setup any prompts to use with the Web Report Studio group breaks.

  /*Must use the graphic device  java image*/

%let _gopt_device=javaimg;  

You must use the Java Image device for this output to work properly.

Update: You can also use the ActivexImg if Javaimg doesn’t work. 

 

 /* =========== Stored Process Output */

%stpbegin;

    goptions reset=all    xpixels=210 ypixels=200;  

proc gkpi mode=raised;

          speedometer

          actual=&YOUR_PCT.

          bounds=(0 .40 .60 1) /   target=.85

          lfont=(f=”Albany AMT” height=.5cm)

          label=”Avg Fix Response Time”

           format=”percent8.0″;

run;

%stpend;

Ensure your LET statements are outside of the %STPBEGIN/%STPEND macros. 

 

Notice the &YOUR_PCT is used for the actual calculation.

Registering the SAS Stored Process

Two things you must do when you register this stored process.

1 – Make sure you turn off the Stored Process Macros (%STPBEGIN/%STPEND) in the SAS Code pane. You already have them in the code and do not need SAS to do it for you.

2 – When you register the stored process, make sure you check that the SAS Result Type is Package.

Stored Process Use Package for Dashboard

Yeah … that’s really all there is to it. The worst part is deciding which gadget you want to use.

Learn all about SAS BI

You can learn more about SAS Business Intelligence from the "SAS BI Bible." Take a peek inside the Building Business Intelligience with SAS book.

The following two tabs change content below.

Tricia Aanderud

Director of Data Visualization at Zencos Consulting
Tricia Aanderud is a SAS Business Intelligence and Visual Analytics consultant based in Raleigh, NC who works for Zencos Consulting. She has written several books about SAS, presented papers at many SAS conferences, and has been using SAS since 2001. Contact her for assistance with your next project.

Tags: , , ,

11 Comments »