Web Report Studio: Adding Dashboard Indicators with a SAS Stored Process
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.
Show me the Code!
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
| /*==== Start Code ==== */
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*/
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 */
goptions reset=all xpixels=210 ypixels=200;
proc gkpi mode=raised;
bounds=(0 .40 .60 1) / target=.85
lfont=(f=”Albany AMT” height=.5cm)
label=”Avg Fix Response Time”
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.
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.
Latest posts by Tricia Aanderud (see all)
- My 7 Favorite Features in SAS Visual Analytics 8.2 on Viya - 2018-01-14
- Creating a Web Analytics Report in SAS Visual Analytics 8.1 - 2017-06-19
- Designing Dashboards: Sending Your Style Vibe - 2017-01-21
- SAS Visual Analytics: Design Versus Reality - 2016-10-05
- Seize the Day! Submit an #SASGF Abstract - 2016-09-21