Fly over, drill down, and explore

Similar documents
ABC s of Graphs in Version 8 Caroline Bahler, Meridian Software, Inc.

Using SAS/GRAPH Software to Create Graphs on the Web Himesh Patel, SAS Institute Inc., Cary, NC Revised by David Caira, SAS Institute Inc.

The Basics of Map Creation with SAS/GRAPH. Mike Zdeb School of Public Health Rensselaer, NY

USING PROC GMAP AND DRILL-DOWN GRAPHICS FOR DATA QUALITY ASSURANCE Meghan Arbogast, Computer Sciences Corporation, Corvallis, OR

Making Presentations More Fun with DATA Step Graphics Interface (DSGI) Hui-Ping Chen, Eli Lilly and Company, Indianapolis, Indiana

The GANNO Procedure. Overview CHAPTER 12

Creating Regional Maps with Drill-Down Capabilities Deb Cassidy Cardinal Distribution, Dublin, OH

The Evolution of a SAS/GRAPH Application Jenine Eason, AutoTrader.com, Atlanta, GA

A Dynamic Imagemap Generator Carol Martell, Highway Safety Research Center, Chapel Hill, NC

New SAS V8 Tricks for Old SAS V6 Dogs: Tips from the Command Line Louise Hadden, Abt Associates Inc., Cambridge, MA

A Macro to replace PROC REPORT!?

How to Make an Impressive Map of the United States with SAS/Graph for Beginners Sharon Avrunin-Becker, Westat, Rockville, MD

Put Your Data on the Map: Using the GEOCODE and GMAP Procedures to Create Bubble Maps in SAS

Effective Forecast Visualization With SAS/GRAPH Samuel T. Croker, Lexington, SC

Multiple Graphical and Tabular Reports on One Page, Multiple Ways to Do It Niraj J Pandya, CT, USA

Paper Mapping Roanoke Island Revisited: An OpenStreetMap (OSM) Solution. Barbara Okerson, Anthem Inc.

SAS/GRAPH Introduction. Winfried Jakob, SAS Administrator Canadian Institute for Health Information

INTRODUCTION TO THE SAS ANNOTATE FACILITY

ODS TAGSETS - a Powerful Reporting Method

SAS/GRAPH and ANNOTATE Facility More Than Just a Bunch of Labels and Lines

Custom Map Displays Created with SAS/GRAPH Procedures and the Annotate Facility Debra Miller, National Park Service, Denver, CO

Six Cool Things You Can Do In Display Manager Jenine Milum, Charlotte, NC Wachovia Bank

PharmaSUG Paper TT10 Creating a Customized Graph for Adverse Event Incidence and Duration Sanjiv Ramalingam, Octagon Research Solutions Inc.

Guide Users along Information Pathways and Surf through the Data

SAS System Powers Web Measurement Solution at U S WEST

The GSLIDE Procedure. Overview. About Text Slides CHAPTER 27

Coders' Corner. Paper ABSTRACT GLOBAL STATEMENTS INTRODUCTION

Easing into Data Exploration, Reporting, and Analytics Using SAS Enterprise Guide

Creating Maps in SAS/GRAPH

Internet/Intranet, the Web & SAS

Developing a Dashboard to Aid in Effective Project Management

Data Annotations in Clinical Trial Graphs Sudhir Singh, i3 Statprobe, Cary, NC

PharmaSUG 2013 CC26 Automating the Labeling of X- Axis Sanjiv Ramalingam, Vertex Pharmaceuticals, Inc., Cambridge, MA

SAS Web Report Studio 3.1

ABSTRACT INTRODUCTION THE ODS TAGSET FACILITY

Overview of SAS/GIS Software

It s Not All Relative: SAS/Graph Annotate Coordinate Systems

ABC Macro and Performance Chart with Benchmarks Annotation

An Efficient Tool for Clinical Data Check

A Generalized Macro-Based Data Reporting System to Produce Both HTML and Text Files

My Reporting Requires a Full Staff Help!

The GEOCODE Procedure and SAS Visual Analytics

Displaying Multiple Graphs to Quickly Assess Patient Data Trends

SAS Graphics & Code. stat 480 Heike Hofmann

Information Visualization

Journey to the center of the earth Deep understanding of SAS language processing mechanism Di Chen, SAS Beijing R&D, Beijing, China

Figure 1. Paper Ring Charts. David Corliss, Marketing Associates, Bloomfield Hills, MI

Maintaining a 'Look and Feel' throughout a Reporting Package Created with Diverse SAS Products Barbara B Okerson, Anthem, Inc.

ODS Meets SAS/IntrNet

Formatting Highly Detailed Reports: Eye-Friendly, Insight-Facilitating

A Revolution? Development of Dynamic And Hypertext Linked Reports With Internet Technologies and SAS System

Leveraging SAS Visualization Technologies to Increase the Global Competency of the U.S. Workforce

ABSTRACT: INTRODUCTION: WEB CRAWLER OVERVIEW: METHOD 1: WEB CRAWLER IN SAS DATA STEP CODE. Paper CC-17

2997 Yarmouth Greenway Drive, Madison, WI Phone: (608) Web:

PharmaSUG China Paper 059

Pete Lund Looking Glass Analytics, Olympia, WA

Multiple Forest Plots and the SAS System

Customized Flowcharts Using SAS Annotation Abhinav Srivastva, PaxVax Inc., Redwood City, CA

Paper ###-YYYY. SAS Enterprise Guide: A Revolutionary Tool! Jennifer First, Systems Seminar Consultants, Madison, WI

Batch Importing. Overview CHAPTER 4

Square Peg, Square Hole Getting Tables to Fit on Slides in the ODS Destination for PowerPoint

Using Annotate Datasets to Enhance Charts of Data with Confidence Intervals: Data-Driven Graphical Presentation

Data Explore Matrix Quality Control by Exploring and Mining Data in Clinical Study

Using Big Data to Visualize People Movement Using SAS Basics

ODS in an Instant! Bernadette H. Johnson, The Blaze Group, Inc., Raleigh, NC

Macro Method to use Google Maps and SAS to Geocode a Location by Name or Address

Leverage custom geographical polygons in SAS Visual Analytics

Streamline Table Lookup by Embedding HASH in FCMP Qing Liu, Eli Lilly & Company, Shanghai, China

Penetrating the Matrix Justin Z. Smith, William Gui Zupko II, U.S. Census Bureau, Suitland, MD

ODS and Web Enabled Device Drivers: Displaying and Controlling Large Numbers of Graphs. Arthur L. Carpenter and Richard O. Smith Data Explorations

Interactive Graphs from the SAS System

A Methodology for Truly Dynamic Prompting in SAS Stored Processes

Annotate Dictionary CHAPTER 11

I KNOW HOW TO PROGRAM IN SAS HOW DO I NAVIGATE SAS ENTERPRISE GUIDE?

DATA Step Debugger APPENDIX 3

How To Get Ten Pounds Of Data Into A Five Pound Can Using Flyover Technique In HTML Output

Purpose: This chapter demonstrates how to create pie charts, and discusses some of the issues to consider when deciding whether to use a pie chart.

Overview 14 Table Definitions and Style Definitions 16 Output Objects and Output Destinations 18 ODS References and Resources 20

Paper S Data Presentation 101: An Analyst s Perspective

SAS IT Resource Management 3.8: Reporting Guide

Create Flowcharts Using Annotate Facility. Priya Saradha & Gurubaran Veeravel

Using PROC REPORT to Cross-Tabulate Multiple Response Items Patrick Thornton, SRI International, Menlo Park, CA

Using SAS Graphics Capabilities to Display Air Quality Data Debbie Miller, National Park Service, Denver, CO

ABSTRACT MORE THAN SYNTAX ORGANIZE YOUR WORK THE SAS ENTERPRISE GUIDE PROJECT. Paper 50-30

Introduction to MDDBs

Outbreak Maps: Visual Discovery in Your Data. Jeff Phillips, Data Visualization R&D

New Visualization in V8.2

Indenting with Style

A SAS Macro to Generate Caterpillar Plots. Guochen Song, i3 Statprobe, Cary, NC

Creating Forest Plots Using SAS/GRAPH and the Annotate Facility

Generating Participant Specific Figures Using SAS Graphic Procedures Carry Croghan and Marsha Morgan, EPA, Research Triangle Park, NC

16 Data Visualizations. to Improve Your Application

Benchmark Macro %COMPARE Sreekanth Reddy Middela, MaxisIT Inc., Edison, NJ Venkata Sekhar Bhamidipati, Merck & Co., Inc.

Paper AD12 Using the ODS EXCEL Destination with SAS University Edition to Send Graphs to Excel

SAS BI Dashboard 3.1. User s Guide Second Edition

SAS Visual Analytics 8.2: Getting Started with Reports

PharmaSUG 2012 Paper CC13

HTML for the SAS Programmer

A SAS Macro Utility to Modify and Validate RTF Outputs for Regional Analyses Jagan Mohan Achi, PPD, Austin, TX Joshua N. Winters, PPD, Rochester, NY

Chapter 13 Introduction to Graphics Using SAS/GRAPH (Self-Study)

Transcription:

ABSTRACT Paper 79-2013 Fly over, drill down, and explore Suzanne Brown, HealthInsight New Mexico, Albuquerque, NM Data often have a spatial dimension, whether it is a five-year financial plan and annual budget, or public health initiatives spanning several counties or states, differences in geographic areas inform healthcare providers or illuminate the differences between regional spending. SAS/Graph and GMAP provide a powerful entry point for investigation. When combined with the power of ODS, GCHART, SAS Macro Language, and Base SAS, data become more user friendly and informative. This paper demonstrates how to incorporate the power of ODS with SAS Graph to draw a map, insert annotation to select a location of interest, use ODS to create drill-down, and explore hyper-linked data tables and charts. Using SAS-supplied datasets to draw map boundaries, we create an annotation data set, use Macros to dynamically create high level and detail reports for each destination, add hyperlinks, and create graphs to turn data into information. INTRODUCTION You don t need much beyond basic SAS software to provide your organization with powerful analytic tools. With BAS SAS and SAS GRAPH, you can create web-based tools to provide your organization and clients insight that turns data into information. We will use some of the most powerful elements in the SAS language to create a map, mark areas of interest and allow your audience to dig deeply into your data. You need the standard SAS Map datasets, some knowledge of the Output Delivery System, and SAS Macro language. THE REALLY BIG PICTURE A MAP! Our organization is operating in the state of New Mexico. We have distribution centers in 23 towns across the state. With the annual budget and multi-year forecasting completed for the year, our town managers are ready to manage to their numbers. New Mexico being a sparsely populated state and the ability of each manger to get to the office is limited the most efficient way for our managers to see this information is to put it on our company web site for their remote access. We use SAS Maps to draw the map of the state and annotate each city. We use a choropleth (two-dimensional) map as supplied by SAS and stored in the Map directory. If you are new to SAS Maps, the SAS Knowledge Base contains the information needed to draw the map boundaries, latitude and longitude, and necessary codes for selecting and identifying geographic locations. To draw our map of New Mexico, we use the USCOUNTY map. New Mexico is State code 35 in the data set. /*make map data */ /* Choose county for NM */ data nmcounty; set maps.uscounty; where state=35; Next we need to create the annotation for our towns and establish an html tag for each. We use the USCITY map to create the html tag for each of our service area locations. Additionally, we create an observation for the town marker; in this case, we are using a star. Style special with text M in the annotation file creates the star for each of our towns. /* 2. get cities for test'2' */ data pubrpt.nmtowns; length function style color $ 8 position $ 1 text $ 20; retain function 'label' Xsys Ysys '2' hsys '3' When 'A' Position Style Text X Y; set maps.uscity (keep=x y city state); if state = 35; if city in('alamogordo',,'grants'); 1

/* add html reference for cities*/ HTML = 'href="' trim( City ) '.html"'; /* create the city html */ style='swissb'; text=city; color='black'; size=2.5; position='8'; output; /* create the star marker*/ style='special'; text='m'; color='morbr'; size=7; position='5'; output; Next we establish the ODS framework for our map. It is important to note, we are using an older SAS html tagset. This is because of the technological restrictions of our client, however, SAS has enhanced the html tagsets. To learn more about them see Eric Gebhart s paper listed in the Suggested Reading section of this paper. /*start fresh with ods */ ods html close;ods listing close; /*create placeholders for ODS html information*/ filename odsout 'C:\@suzanne\Budget2013\reporting\HTML Presentation\'; ODS HTML body='drillmapbody.html' attributes=("codebase"="c:\program files\sas institute\applets") parameters=("drilldownmode"="url") path=odsout; Using the graphic options, we can establish the colors we want for our map. We choose colors that correspond to our company branding. GOPTIONS reset=all xpixels=650 ypixels=470 DEVICE=html; pattern1 v=s c=cream; pattern2 v=s c=cream; pattern3 v=s c=cream; pattern4 v=s c=cream; pattern5 v=s c=cream; pattern6 v=s c=cream; pattern7 v=s c=cream; Now we have everything we need to draw our map. Proc GMAP option CHORO draws the choropleth map. We specified the color sequence in the GOPTIONS statement. The GMAP statement specifies the width and color of county boundaries. proc gmap data=nmcounty map=nmcounty; id county; choro county/annotate=bud2013.nmtowns woutline=1 coutline=liolbr nolegend; This is our map! Figure 1. Map of New Mexico with Markers at Service Areas 2

GATHER TABLE INFORMATION Now that we have the map, we need to prepare the data to link to the towns. Our data is by product line and town. Proc SQL does a good job of creating our summary information. We use the same concatenation technique we used in creating the html tags for the map to create the html reference for each town. create table monthly as select a.town, a.rs as budget, b.rsname as Desc, sum(a.m1) format=dollar12. as Jan, (,,,code for summarizing each month is omitted,,,) sum(a.m12) format=dollar12. as Dec, 'href="' trim( town ) 'Y13.html"' as HTML from pubrpt.rev2013a a, wobegone.productxref b where year eq 2013 and a.prodline eq b.prodline group by a.town, a.rs, b.prodname, a.year; quit; Next, we create the table of annual planning forecast data for the next several years: create table aop as select year, salsloc, town as town, sum(b12) as b12, sum(prodtot) as prodtot, sum(mtot)as mtot from bud2013.rev2013, 'href="' trim( town ) 'prod.html"' as HTML group by year, salsloc, town; quit; A similar data table is created with data we use for a graph later on. CREATE DRILL-DOWN TABLES FOR EACH LOCATION We want each town manager to click the marker for their town and see the information we have assembled. Proc Report and the SAS Macro language together allow us to create the table for each town. The SAS Macro Group writes a table for each town with the macro variable &group. Using styles within Proc Report, we format the tables according to our corporate standard. In the Compute block, we add the fly-over text to aid our managers to drill through the information. The STYLE= option creates the value for the STYLE attribute. Here we use style=(flyover= Click.) to get the screen tip click to go to the monthly budget. %macro create(group); ods html file="c:\@sample\budget2013\reporting\html Presentation\&group..html" newfile=page; title "&group" color=delog; proc report data=work.monthly (where=(town="&group")) nowd wrap center ls=120 ps=40 style(lines)={background=white foreground=black font_face="calibri" font_weight=bold} style(report)={frame="border"} ( more style lines here ) column town year b12 ttot mtot; (more code here to define the report lines) break after year / skip color=white; /*create hyperlink to 2013 files*/ compute year; if year = 2013 then do; href=trim(town) 'Y13.html'; call define(_col_,"urlp",href); call define(_col_, 'style', style={flyover="click to go to 2013 3

Monthly Budget"}'); end; else do; call define(_col_,"style","style(calldef)={background=white foreground=black}"); end; endcomp; We run similar code to create the reporting format for the annual planning forecast data and include a hyperlink in the first year that allows us to drill to a chart. ADD A CHART Sometimes a picture tells a more compelling story. Proc GCHART option PIE draws a pie chart of the revenue per product line. We create a data file product1 with html tags as we did for the annual operating plan and monthly budget for use in charting. When our town managers click on the product Boots, they see a pie chart of the margin composition. proc gchart data=pc1; Title "Margin Composition for &group"; where town="&group"; pie desc /noheading levels=3 sumvar=mtot name="&group"; quit; Finally, we use CALL EXECUTE to create the html files our web administrators need. When CALL EXECUTE runs, it sends the character string that is between the parentheses to the macro. From the data set q1, the CALL EXECUTE creates an html file for each of our locations. Data _null_; set q1; call execute('%create(' town ')'); PUTTING IT ALL TOGETHER To explore the budget, our manager in Carlsbad, New Mexico clicks on the Carlsbad star on the map and sees this table. The flyover message Click to go to 2013 Monthly Budget appears when selecting the hyperlink at 2013. Carlsbad Year Outlets Inventory Sales 2013 65 $1,356,501 $395,603 2014 101 $1,212,116 $395,600 2015 139 $2,621,070 $851,206 Table 2. Sample Annual Operating Plan for Carlsbad 4

Clicking 2013 takes us to the categorized monthly budget for the year. Carlsbad 2013 Budget ID Desc Jan Feb Nov Dec Total 10 Boot $ 1,775 $ 1,775. $ 1,775 $ 1,775 $ 21,297 20 Men's Casual $ 5,267 $ 5,267. $ 5,267 $ 5,267 $ 63,206 30 Men's Dress $ 10,312 $ 10,312. $ 10,312 $ 10,312 $ 123,743 40 Sandal $ 2,433 $ 2,433. $ 2,433 $ 2,433 $ 29,198 50 Slipper $ 5,408 $ 5,408. $ 5,408 $ 5,408 $ 64,891 60 Sport Shoe $ 218 $ 218. $ 218 $ 218 $ 2,617 70 Women's Casual $ - $ -. $ - $ - $ - 80 Women's Dress $ 25,918 $ 25,918. $ 25,918 $ 25,918 $ 311,017 Table 3. Sample Annual Operating Plan for Carlsbad Clicking on Boot takes us to a pie chart showing the margin contribution of each product line. Figure 2. Sample Margin Composition Chart CONCLUSION It could take 5 different software applications to develop a drill down geographical presentation. SAS does it in a few easy steps. As shown in this simple example, time to implement a web-based solution can be minimized by using SAS MAP, ODS and Proc Report as you develop the reporting code. SAS continues to enhance web-based reporting and the SAS programmer has the ability to create sophisticated reporting. As businesses are forced to do more with less, SAS can alleviate some of the burden on web programmers by creating simple, drillable tables and graphs. RECOMMENDED READING Base SAS Procedures Guide SAS Knowledge Base and SAS Support Communities 5

Paper 005-2010 ODS HTML Evolution: HTML that Scrolls, Panels, Floats, Reads, and Integrates by Eric Gebhart, SAS Institute Inc., Cary, NC CONTACT INFORMATION Your comments and questions are valued and encouraged. Contact the author at: Name: Suzanne Brown Enterprise: HealthInsight New Mexico Address: 5801 Osuna Road NE Suite 200 City, State ZIP: Albuquerque NM 87109 Work Phone: 505.998.9763 Fax:505.884.0954 E-mail: sbrown@healthinsight.org Web: www.healthinstight.org SAS and all other SAS Institute Inc. product or service names are registered trademarks or trademarks of SAS Institute Inc. in the USA and other countries. indicates USA registration. Other brand and product names are trademarks of their respective companies. 6