Web Report Studio: Souped up Dashboard Speedometers, Sliders, and Dials

This post was kindly contributed by Business Intelligence Notes for SAS BI Users - go there to comment and to read the full post.

Sometimes SAS Web Report Studio needs some dashboard dials and sliders that seems like mission impossible for you. However, add a 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 contains 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 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. I’m not aware of any difficulties using this device and it works in my testing.  But please comment below if you know of issues. 
 /* =========== 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 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, ensure 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 More

In the upcoming Building Business Intelligence with SAS book, you can learn more about using SAS Web Report Studio, SAS Stored Process, and building dashboard using the SAS BI Dashboard. Sign up to have SAS Press send you an email when it’s available! 

This post was kindly contributed by Business Intelligence Notes for SAS BI Users - go there to comment and to read the full post.