0% found this document useful (0 votes)
363 views160 pages

SAS VA - Basics - Slides With Notes

Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
363 views160 pages

SAS VA - Basics - Slides With Notes

Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 160

SAS® Visual Analytics 1

for SAS® Viya®: Basics


Course Notes
SAS® Visual Analytics 1 for SAS® Viya®: Basics Course Notes was developed by Nicole Ball and
Lynn Mathews. Additional contributions were made by Richard Bell, Beth Hardin, Lynn Matthews,
Theresa Stemler, and Stacey Syphus. Instructional design, editing, and production support was
provided by the Learning Design and Development team.
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.
SAS® Visual Analytics 1 for SAS® Viya®: Basics Course Notes

Copyright © 2021 SAS Institute Inc. Cary, NC, USA. All rights reserved. Printed in the United States
of America. No part of this publication may be reproduced, stored in a retrieval system, or
transmitted, in any form or by any means, electronic, mechanical, photocopying, or otherwise,
without the prior written permission of the publisher, SAS Institute Inc.

Book code E78787, course code YVA11D, prepared date 22Nov2021. YVA11D_001

ISBN 978-1-955977-23-4
For Your Information iii

Table of Contents

To learn more… ...................................................................................................... iv

Lesson 1 Getting Started with SAS Visual Analytics............................................... 1-1

1.1 Introduction to SAS Visual Analytics ......................................................................... 1-5

1.2 Exploring the Visual Analytics Course Environment ............................................... 1-12

1.3 Viewing Visual Analytics Reports ............................................................................ 1-20

Lesson 2 Preparing Data Using SAS Data Studio .................................................... 2-1

2.1 Investigating Data in SAS Visual Analytics ............................................................... 2-4

2.2 Transforming Data Using SAS Data Studio ............................................................ 2-16

Lesson 3 Analyzing Data Using SAS Visual Analytics ............................................ 3-1

3.1 Working with Data Items............................................................................................ 3-5

3.2 Exploring Data with Charts and Graphs .................................................................. 3-11

3.3 Creating Data Items and Applying Filters ................................................................ 3-22

3.4 Performing Data Analysis ........................................................................................ 3-49

Lesson 4 Designing Reports with SAS Visual Analytics ........................................ 4-1

4.1 Creating a Simple Report .......................................................................................... 4-4

4.2 Creating Interactive Reports .................................................................................... 4-16

4.3 Working with Display Rules ..................................................................................... 4-36


iv For Your Information

To learn more…
For information about other courses in the curriculum, contact the
SAS Education Division at 1-800-333-7660, or send e-mail to
[email protected]. You can also find this information on the web at
http://support.sas.com/training/ as well as in the Training Course
Catalog.

For a list of SAS books (including e-books) that relate to the topics
covered in this course notes, visit https://www.sas.com/sas/books.html or
call 1-800-727-0025. US customers receive free shipping to US
addresses.
Lesson 1 Getting Started with
SAS Visual Analytics
1.1 Introduction to SAS Visual Analytics ................................................................................... 1-5

1.2 Exploring the Visual Analytics Course Environment........................................................ 1-12

1.3 Viewing Visual Analytics Reports ....................................................................................... 1-20


1-2 Lesson 1 Getting Started with SAS Visual Analytics

Copyright © 2021, SAS Institute Inc., Cary, North Carolina, USA. ALL RIGHTS RESERVED.
1.1 Introduction to SAS Visual Analytics 1-3

Introduction

Data collection

SAS Visual Analytics Preparing and


accessing data

SAS Cloud Analytic Services (CAS) Discovering trends,


developing insights,
and creating reports

As technology progresses and data collection becomes cheaper and easier, companies are able to
collect more and more data from a variety of sources. This data can range from general data, like the
number of visits to a website, to very specific data, like the pages a user visits before buying a
product. All this data can be truly daunting. You get data by the second, but it takes time to use and
analyze this data. SAS Visual Analytics coupled with the power of Cloud Analytic Services (CAS)
enables you to spend less time preparing and accessing the data and more time discovering trends,
developing insights, and creating visually stunning reports to showcase your data.

Copyright © 2021, SAS Institute Inc., Cary, North Carolina, USA. ALL RIGHTS RESERVED.
1-4 Lesson 1 Getting Started with SAS Visual Analytics

SAS Visual Analytics

Sample report
SAS Viya

Course environment

In this lesson, you learn more about Visual Analytics and the course environment. First, you learn
about how Visual Analytics fits into SAS Viya. Then, you learn more about the environment used for
this course. Finally, you sign in to Visual Analytics and view a sample report to see some of the
elements that you can use when building reports on your data.

Copyright © 2021, SAS Institute Inc., Cary, North Carolina, USA. ALL RIGHTS RESERVED.
1.1 Introduction to SAS Visual Analytics 1-5

1.1 Introduction to SAS Visual Analytics

SAS Visual Analytics

Explore data
Analyze massive Import data
amounts of data

Create reports Share insights

Visual Analytics uses SAS High-Performance technologies to accelerate analytic computations,


which helps you derive value from massive amounts of data. This gives you the power to solve
difficult problems, improve business performance, predict future performance, and mitigate risk
rapidly and confidently. You can import data of any size into Visual Analytics to quickly identify trends
and patterns that you might not have noticed before.
Then, you can take your analysis a step further by creating powerful statistical models on the
patterns that you discovered (with SAS Visual Statistics). After you identify those patterns and get a
better feel for your data, you can create reports or dashboards to share with anyone, anywhere via
the web or a mobile device.
In traditional reporting, the output is well defined up front. That is, you know what you are looking at
and what you need to convey to your audience. Data discovery with Visual Analytics, however,
invites you to plumb the data, its characteristics and relationships, and build reports based on your
discoveries.

Copyright © 2021, SAS Institute Inc., Cary, North Carolina, USA. ALL RIGHTS RESERVED.
1-6 Lesson 1 Getting Started with SAS Visual Analytics

SAS Cloud Analytic Services (CAS)

High speed Resilient

Fault tolerance
Node-to-node
communication Scalable

In this course, you use SAS Visual Analytics in SAS Viya, a cloud-ready analytics and data
management engine. At the heart of SAS Viya is Cloud Analytic Services (CAS), a server that
provides the run-time environment for data management and analytics.
When performing analytics, CAS efficiently spreads big data processing across all nodes in the
cluster, which results in very fast operations. In this configuration, CAS has a communications layer
that supports fault tolerance, meaning it can continue processing requests even after losing
connectivity to some nodes. It does this by distributing work to other nodes. This communications
layer also enables you to dynamically delete and add nodes to the system while the server is
running.

Copyright © 2021, SAS Institute Inc., Cary, North Carolina, USA. ALL RIGHTS RESERVED.
1.1 Introduction to SAS Visual Analytics 1-7

SAS Cloud Analytic Services (CAS)

Symmetric Multiprocessing (SMP) Massively Parallel Processing (MPP)

CAS is designed to run in a single-machine (symmetric multiprocessing, SMP) or multi-machine


(massively parallel processing, MPP) configuration. For both configurations, the CAS server uses
multi-threaded algorithms to rapidly perform analytic processing on in-memory data of any size. In
fact, the CAS server can continue processing data even when the memory capacity of the server is
exceeded.
In the single-machine configuration, all processing is completed on one node. The multi-machine
configuration, however, consists of one controller and one or more worker nodes, and provides
optimal processing capabilities.

Copyright © 2021, SAS Institute Inc., Cary, North Carolina, USA. ALL RIGHTS RESERVED.
1-8 Lesson 1 Getting Started with SAS Visual Analytics

SAS Visual Analytics

Third-party
languages
SAS Studio

REST APIs

Command line

In addition to using SAS Viya applications to access CAS, you can also use scripts via a command
line, REST APIs, and third-party languages (such as Python, R, Lua, and Java).

SAS Viya
SAS Drive

SAS Viya consists of many different applications that enable you to take advantage of the powerful
CAS server. Let's take a high-level look at how these applications interact. The entry point for SAS
Viya is SAS Drive, a collaborative interface for accessing, organizing, and sharing content. This
application is the gateway to all other applications in SAS Viya.

Copyright © 2021, SAS Institute Inc., Cary, North Carolina, USA. ALL RIGHTS RESERVED.
1.1 Introduction to SAS Visual Analytics 1-9

SAS Studio SAS Data Studio

SAS Cloud Analytic Services (CAS)

You can use SAS Studio to perform programming tasks to manage, prepare, and analyze your data.
Using SAS Data Studio, you can prepare CAS tables and create CAS tables using transforms.

SAS Visual Analytics

SAS Studio SAS Data Studio

SAS Cloud Analytic Services (CAS)

When your tables are ready for analysis, you can use Visual Analytics to visualize data, build
statistical models, and create interactive reports.

Copyright © 2021, SAS Institute Inc., Cary, North Carolina, USA. ALL RIGHTS RESERVED.
1-10 Lesson 1 Getting Started with SAS Visual Analytics

SAS Visual Analytics

SAS Visual Analytics SAS Visual Analytics App

Reports that are created in Visual Analytics can be viewed in a browser or on a tablet or mobile
device using the SAS Visual Analytics App.

SAS Visual Analytics

SAS Theme Designer SAS Graph Builder

You can also use SAS Theme Designer to customize the look and feel of your applications and
reports or use SAS Graph Builder to create custom graph objects for Visual Analytics.

Copyright © 2021, SAS Institute Inc., Cary, North Carolina, USA. ALL RIGHTS RESERVED.
1.1 Introduction to SAS Visual Analytics 1-11

SAS Data Explorer SAS Environment Manager

SAS Lineage Viewer

In addition, you can view, reload, and import data to CAS using SAS Data Explorer, manage the
environment using SAS Environment Manager, and view and understand relationships between
objects using SAS Lineage Viewer.

Copyright © 2021, SAS Institute Inc., Cary, North Carolina, USA. ALL RIGHTS RESERVED.
1-12 Lesson 1 Getting Started with SAS Visual Analytics

1.2 Exploring the Visual Analytics Course


Environment

SAS Visual Analytics Methodology

Access Investigate Prepare Analyze Report

The Visual Analytics methodology is a step-by-step process that you can follow when using Visual
Analytics. The methodology is divided into five phases: Access, Investigate, Prepare, Analyze, and
Report.
In the Access phase, you identify the analysis tables that will be used in Visual Analytics and load
those tables into CAS. In the Investigate phase, you inspect the tables to determine whether any
changes are needed for data items due to data inconsistencies or data quality issues. In this phase,
you also identify any new data items that need to be created. In the Prepare phase, you correct any
data quality issues and create any new calculated items needed for analysis. In the Analyze phase,
you explore the data to identify any patterns, relationships, and trends. Lastly, in the Report phase,
you develop interactive reports that can be shared via the web or a mobile device. In this course,
you step through the phases consecutively. However, it is possible to skip some phases or perform
them simultaneously or out of order.

Copyright © 2021, SAS Institute Inc., Cary, North Carolina, USA. ALL RIGHTS RESERVED.
1.2 Exploring the Visual Analytics Course Environment 1-13

Business Scenario

Folder structure
Environment Users and capabilities

Demos (Marketing)

Practices (HR)

As the new analyst and report designer at Orion Star, you need to apply the Visual Analytics
methodology to analyze your data and create some requested reports. However, before you begin,
you need to become familiar with the Visual Analytics environment and the folder structure. You also
need to learn a bit about your colleagues and their job roles and capabilities with regard to SAS Viya
and Visual Analytics. Let's start by looking at the types of users at Orion Star and the applications
that they can use to perform their jobs.

Analyst Analyst

Data Scientist Data Administrator

Administrator Information Consumer

Copyright © 2021, SAS Institute Inc., Cary, North Carolina, USA. ALL RIGHTS RESERVED.
1-14 Lesson 1 Getting Started with SAS Visual Analytics

Orion Star currently has five different job roles: analysts, data scientists, data administrators,
environment administrators, and information consumers.

Analyst Analyst

Data Scientist Data Administrator

SAS Visual Analytics

Administrator Information Consumer

Analysts, like you, analyze data and build reports, so they use Visual Analytics.

Analyst Analyst

SAS Visual Statistics


Data Scientist Data Administrator

SAS Visual Data Mining


and Machine Learning

Administrator Information Consumer

The data scientists build statistical models to improve business performance, so they use Visual
Statistics and Visual Data Mining and Machine Learning, which can be accessed through Visual
Analytics.

Copyright © 2021, SAS Institute Inc., Cary, North Carolina, USA. ALL RIGHTS RESERVED.
1.2 Exploring the Visual Analytics Course Environment 1-15

Analyst Analyst

Data Scientist Data Administrator

SAS Data Studio

Administrator Information Consumer

The data administrators prepare the data for the analysts and can use SAS Data Studio to do so.

Analyst Analyst

Data Scientist Data Administrator

SAS Environment
Manager

Administrator Information Consumer

The environment administrators manage the environment by creating folders, adding users, and
making sure that users can access only the content that they need to perform their job. They use
SAS Environment Manager to perform these functions.

Copyright © 2021, SAS Institute Inc., Cary, North Carolina, USA. ALL RIGHTS RESERVED.
1-16 Lesson 1 Getting Started with SAS Visual Analytics

Analyst Analyst

Data Scientist Data Administrator

SAS Visual Analytics

Administrator Information Consumer

Information consumers are the users who view any reports that you create. These can be executives
and managers who want to better understand the current state of the organization so that they can
plan for the future, or it can be users with other job roles in the organization, like other analysts or
data scientists. All users can view reports from Visual Analytics.

Question – Viewing and Creating Reports


Which of the following statements is true?
a. All users have the ability to create reports.
b. Administrators control access to reports.
c. Only administrators can create reports.

Copyright © 2021, SAS Institute Inc., Cary, North Carolina, USA. ALL RIGHTS RESERVED.
1.2 Exploring the Visual Analytics Course Environment 1-17

Answer – Viewing and Creating Reports


Which of the following statements is true?
a. All users have the ability to create reports.
b. Administrators control access to reports.
c. Only administrators can create reports.

Administrators manage role-based capabilities, which control the application


features that each group of users can access.

Security also enables the administrator to control which data sources, plans,
and reports each group of users can access.

Course Environment

Demos (Marketing)
YVA1

Practices (HR)

In this course, all users access and store plans and reports in a folder structure that has been
created and secured by the environment administrator. One main folder (YVA1) has been created to
hold all course content. Two subfolders have also been created, one for each division that you work
with for the business scenario. The Demos (Marketing) folder contains all plans and reports that
have been built for Marketing Division requests. The Practices (HR) folder contains all plans and
reports that have been built for HR Division requests. Each folder also contains solutions.

Copyright © 2021, SAS Institute Inc., Cary, North Carolina, USA. ALL RIGHTS RESERVED.
1-18 Lesson 1 Getting Started with SAS Visual Analytics

Exploring SAS Drive


This demonstration illustrates signing
in and exploring the components of SAS Drive.

Activity – Using SAS Drive


• Sign in to SAS Viya
• Where can you find which applications you can access in SAS Viya?
• Add the Product Report object (located in the SAS Content/Courses/YVA1 folder)
to the Quick Access area of SAS Drive.

Copyright © 2021, SAS Institute Inc., Cary, North Carolina, USA. ALL RIGHTS RESERVED.
1.2 Exploring the Visual Analytics Course Environment 1-19

Answer – Using SAS Drive


Where can you find which applications you can access in SAS Viya?
Applications menu

Navigate to the Courses  YVA1 folder.


Right-click the Product Report object and select Pin to Quick Access.
Product Report should appear in the Quick Access area.

You might need to expand the


Quick Access area.

Copyright © 2021, SAS Institute Inc., Cary, North Carolina, USA. ALL RIGHTS RESERVED.
1-20 Lesson 1 Getting Started with SAS Visual Analytics

1.3 Viewing Visual Analytics Reports

Business Scenario
Product Report

Sales

64 suppliers 3,151 products

Before you begin working for your assigned division at Orion Star, your manager wants you to look
at a report created by the Sales team so that you can understand the features that can be used
within reports. The Product Report shows details about the suppliers and products of Orion Star and
was created to help executives, marketing managers, and sales representatives better understand
the products.

Copyright © 2021, SAS Institute Inc., Cary, North Carolina, USA. ALL RIGHTS RESERVED.
1.3 Viewing Visual Analytics Reports 1-21

The Product Report contains three visible pages: Report Overview, Supplier Analysis, and Product
Analysis.
The Report Overview page gives an overview of the report and describes the other sections of the
report.

The Supplier Analysis page gives details about the suppliers for Orion Star, including information
about locations, the products manufactured, and the quantity sold and profit generated by each
supplier.

Copyright © 2021, SAS Institute Inc., Cary, North Carolina, USA. ALL RIGHTS RESERVED.
1-22 Lesson 1 Getting Started with SAS Visual Analytics

The Product Analysis page gives details about the products sold by Orion Star, including information
about product categories and groups, the top 10 cities by orders and profits, and historical details.

Viewing Reports
This demonstration illustrates how to
view a report in Visual Analytics.

Copyright © 2021, SAS Institute Inc., Cary, North Carolina, USA. ALL RIGHTS RESERVED.
1.3 Viewing Visual Analytics Reports 1-23

Practice: Viewing a Report in


Visual Analytics
This practice reinforces the concepts
discussed previously.

Activity – Viewing a Report


Open the Product Report (located in the Courses/YVA1 folder)
and view the Product Analysis page.

Right-click the treemap and select Change Treemap to. What is the recommended
object?

Copyright © 2021, SAS Institute Inc., Cary, North Carolina, USA. ALL RIGHTS RESERVED.
1-24 Lesson 1 Getting Started with SAS Visual Analytics

Answer – Viewing a Report


1. Navigate to the Courses/YVA1 folder.
2. Double-click Product Report to open it.
3. Click the Product Analysis page tab.
4. Right-click the treemap and select Change Treemap to.

What is the recommended object? Bar chart

The report designer can set the level of viewer


customization. By default, viewers can perform
comprehensive edits (change object types).

Viewer customization levels are discussed in more detail in a later lesson. For more information
about Viewer Customization, see “Specify Options for a Report” in the SAS Visual Analytics: Working
with Report Content documentation.

Copyright © 2021, SAS Institute Inc., Cary, North Carolina, USA. ALL RIGHTS RESERVED.
Lesson 2 Preparing Data Using
SAS Data Studio
2.1 Investigating Data in SAS Visual Analytics.......................................................................... 2-4

2.2 Transforming Data Using SAS Data Studio ....................................................................... 2-16


2-2 Lesson 2 Preparing Data Using SAS Data Studio

Copyright © 2021, SAS Institute Inc., Cary, North Carolina, USA. ALL RIGHTS RESERVED.
2.1 Investigating Data in SAS Visual Analytics 2-3

Introduction

Load tables into CAS Investigate data

$
£ ¥

Modify data properties Create data items

Most organizations have their data stored in multiple databases in many different formats. Before
you can analyze and report on this data, your first step is to identify the tables that you need and
load them into CAS. Then, you need to investigate the data structure and data quality and make any
necessary changes needed for the analysis. In this lesson, you learn how to access data and what
types of data can be used in SAS Visual Analytics. Then, you learn how to use Visual Analytics to
learn more about the data and to spot any data quality issues that might exist. Finally, you use SAS
Data Studio to correct the data quality issues and create any data items needed for your analysis.

Copyright © 2021, SAS Institute Inc., Cary, North Carolina, USA. ALL RIGHTS RESERVED.
2-4 Lesson 2 Preparing Data Using SAS Data Studio

2.1 Investigating Data in SAS Visual


Analytics

Business Scenario

Marketing Profits
68,300 customers

747,953 orders Shipping Delivery times

You have recently been hired as an analyst and report designer for the Marketing Division of Orion
Star.
For your first assignment, you have been asked to analyze customer orders. Specifically, the
Marketing team has asked for an analysis of profits, and the Shipping team has asked for an
analysis of delivery times.
You need to investigate the data to determine whether it is ready to be used for this analysis. If not,
you need to make a list of changes required to get the data in shape.

Copyright © 2021, SAS Institute Inc., Cary, North Carolina, USA. ALL RIGHTS RESERVED.
2.1 Investigating Data in SAS Visual Analytics 2-5

Visual Analytics Methodology: Access

Access

Load tables into CAS

Identify analysis tables

In the Access phase of the Visual Analytics methodology, you identify the analysis tables that will be
used in Visual Analytics and load those tables into CAS.
To identify the analysis tables, you need to discuss the intended uses for the tables with your
analysts. When you understand their goals, you can locate the tables and load them into CAS for
immediate use.

Copyright © 2021, SAS Institute Inc., Cary, North Carolina, USA. ALL RIGHTS RESERVED.
2-6 Lesson 2 Preparing Data Using SAS Data Studio

Access

SAS Environment Manager SAS Visual Analytics

Tables can be loaded into CAS in many ways. The method that you choose depends on your role
and the types of changes that you need to make to the table before it is loaded.
If no changes need to be made to the table, an administrator could import it into CAS using SAS
Environment Manager. Sometimes administrators configure a feature called self-service import,
which enables analysts and data scientists to import the data themselves using Visual Analytics.

Copyright © 2021, SAS Institute Inc., Cary, North Carolina, USA. ALL RIGHTS RESERVED.
2.1 Investigating Data in SAS Visual Analytics 2-7

Access

SAS Cloud Analytic Services (CAS) SAS Visual Analytics

Local Server

Self-service import makes it easy for the users to access data quickly and easily. With this feature,
they can import many types of data, including local files (like Microsoft Excel spreadsheets, text files,
SAS data sets, or data from the clipboard), and server data (like Teradata, Oracle, Hadoop, or
Impala).

Copyright © 2021, SAS Institute Inc., Cary, North Carolina, USA. ALL RIGHTS RESERVED.
2-8 Lesson 2 Preparing Data Using SAS Data Studio

Access

SAS Environment Manager SAS Visual Analytics

SAS Studio
SAS Data Studio Open- source
languages
SAS Enterprise Guide

However, if data changes need to be made, other methods can be used. For example, a data
administrator can use SAS Data Studio to create a CAS table after a series of transforms have been
applied. In addition, any users can write code to modify a table and load the result to CAS. This code
can be SAS code written in SAS Studio or SAS Enterprise Guide, or code written in any supported
open-source languages, like Python, Lua, and Java.

Visual Analytics Methodology: Investigate

Investigate

Table size
Detail data

Table contents
Data quality
Table shape Calculated
issues
columns

In the Investigate phase of the Visual Analytics methodology, you inspect the data.

Copyright © 2021, SAS Institute Inc., Cary, North Carolina, USA. ALL RIGHTS RESERVED.
2.1 Investigating Data in SAS Visual Analytics 2-9

Specifically, you’re interested in understanding your data in broad terms. You want to note the size
(the number of rows and columns), the shape (whether the table is wide or narrow), and the contents
(the number of character, datetime, and numeric variables in the table).
In this phase, you also look at the detail data to determine whether there are any data changes that
are needed.
These data changes could be the result of data quality issues or variables with a significant number
of missing values. These could be signs of faulty data preparation and will need to be detected (and
fixed) as early as possible.
The data changes can also include new data items that need to be created for the analysis. For
example, if you want to analyze delivery times, but your table contains only the delivery date and the
order date, you need to calculate the number of days for delivery.

Data Types

Investigate

• Treated as measures
• Used in computations
• Descriptive statistics are displayed

• Treated as categories
• Used to group and aggregate measures
• Distinct counts are displayed

As part of the Investigate phase, you need to determine the contents of the analysis table (that is,
the number of character, datetime, and numeric variables in the table).
In Visual Analytics, character and datetime data items are treated as categories. These are data
items whose distinct values can be used to group and aggregate measures. In Visual Analytics,
distinct counts are displayed for each category data item. This is useful for understanding your data
and pinpointing any issues that might need to be addressed. For example, if you have a Loyalty
data item with six distinct values (Y, Yes, N, No, 0, 1), your data might need to be cleaned before it
can be used for analysis.
Numeric data items, however, are treated as measures. These are data items whose values can be
used in computations. In Visual Analytics, you can see descriptive statistics for measures, including
the minimum, maximum, standard deviation, skewness, and kurtosis. These descriptive statistics are
useful for understanding the range of your measures and can be helpful in building models.

Copyright © 2021, SAS Institute Inc., Cary, North Carolina, USA. ALL RIGHTS RESERVED.
2-10 Lesson 2 Preparing Data Using SAS Data Studio

Tables and Automatic Charts

Crosstab

• View distinct categories and summary


of measures
• Spot data quality issues
List table
• Low-cardinality categories in columns
• High-cardinality categories in rows
• View summary or detail data
• See values for each column
• Identify range of values
• Spot obvious data quality issues

Another part of the Investigate phase is viewing your data to better understand the size, structure,
and data values.
There are many report objects available for viewing and understanding your data, but perhaps the
easiest object to use is the list table. The list table can be used to view summary or detail data. This
is especially useful when you are viewing the data for the first time. It gives you an idea about the
values for each column and the range of values that you can expect to see. Viewing data in a list
table is an easy way to spot obvious data quality issues.
Another great object for learning about your data is the crosstab. This object is especially useful for
viewing distinct values for category data items and summary information for your measures. This can
also be helpful in spotting data quality issues and for gaining a broader insight into your data. When
you use a crosstab, it’s recommended that categories with lower cardinality (that is, categories with
few distinct values) be placed in the Columns role and categories with higher cardinality (that is,
categories with many distinct values) be placed in the Rows role. This enables users to quickly and
easily read the table without a lot of scrolling.

Copyright © 2021, SAS Institute Inc., Cary, North Carolina, USA. ALL RIGHTS RESERVED.
2.1 Investigating Data in SAS Visual Analytics 2-11

• Quick view of data


• Selects best chart type
Automatic chart

ρ
ρ ρ
ρ ρ ρ

Another way to get a quick view of your data is to use an automatic chart. The automatic chart is a
special type of report object that selects the chart type based on the data that is assigned to it. For
example, if you assign a Geography data item and two measures to the automatic chart, you get a
geo map on which the bubble placement indicates the geographic location, the size of the bubble
represents one measure, and the color of the bubble represents the other measure. Conversely, if
you were to assign five measures to the automatic chart, you get a correlation matrix in which the
color of the cells indicates the linear relationship between those measures. This is a great chart type
to use when you need to compare data items but are unsure of the best way to do so.

Copyright © 2021, SAS Institute Inc., Cary, North Carolina, USA. ALL RIGHTS RESERVED.
2-12 Lesson 2 Preparing Data Using SAS Data Studio

Data Items Chart Type

One measure Histogram

One category and any number of measures Bar chart

One datetime category and any number of measures Time series plot

One date or datetime category and one or more categories List table

One geography and up to two measures Geo map

One geography and three or more measures Bar chart

One hierarchy and any number of measures Bar chart

One hierarchy, one or more categories, and any number of other Crosstab
data items

Two or more hierarchies and any number of other data items Crosstab

Two or more categories and any number of measures List table

Two or three measures Scatter plot or heat map*

Four or more measures Scatter plot matrix or


correlation matrix*

* The actual chart type depends on the cardinality of the data.

Activity – Using Suggestions


Sign in to SAS Viya.

1. Create a new report using the PRODUCTS_CLEAN table.


a) From SAS Drive, click Applications menu and select
Explore and Visualize.
b) Select Start with Data.
c) In the Choose Data window, select PRODUCTS_CLEAN.
2. Which objects are suggested for the table?
Add one or two suggested objects to the canvas.

Copyright © 2021, SAS Institute Inc., Cary, North Carolina, USA. ALL RIGHTS RESERVED.
2.1 Investigating Data in SAS Visual Analytics 2-13

Suggested objects are generated in the following ways:

Correlated A correlation query runs against the data source. The suggested object has
measures the lowest cardinality data item and the two most correlated measures. This
can generate a butterfly chart, a dual axis bar chart, or a dual axis bar-line
chart.

Lowest The lowest cardinality data item, a category with at least six distinct values, in
cardinality the data source is used to create the suggested object using frequency. This
can generate a bar chart, a dot plot, a line chart or needle plot, a pie chart, a
treemap, or a word cloud.

Custom data Custom data items are detected in the following order: hierarchies, custom
items categories, calculated items. Suggested objects are generated for each
custom data item. The generated objects are the same as those listed for
lowest cardinality.

Date data items If the data source contains a date or time data item, a suggested object
(typically a time series plot) is generated using a random measure.

Single A histogram or key value object is generated for a single measure.


measures

Note: The Suggestions pane is not available if the Bypass retrieving cardinality values for the
Data pane or Bypass retrieving correlation values for the Data pane setting is selected.
For more information about the suggested objects, see “About the Suggestions Pane” in the SAS
Visual Analytics: Working with Report Content documentation.

Answer – Using Suggestions


Which objects are suggested for the table?
Suggested objects will vary.

Click and drag one of the suggested objects, from the Suggest pane, to the canvas.

Copyright © 2021, SAS Institute Inc., Cary, North Carolina, USA. ALL RIGHTS RESERVED.
2-14 Lesson 2 Preparing Data Using SAS Data Studio

Accessing and
Investigating Data
This demonstration illustrates how to
access data in Visual Analytics through
self-service import and how to investigate
data for the business scenario.

Practice Scenario

Promotion Criteria

Human Resources
Tenure
Appreciation

Job title Sales

Hire month
Salaries

For the practices, you are assuming the role of a person who has been hired as an analyst and
report designer for the Human Resources Division of Orion Star.
For your first assignment, the Human Resources team has asked for an analysis of salaries to
determine which employees could be eligible for promotion. They would like to look at promoting
employees based on certain attributes, mainly their current job title, tenure, and sales
accomplishments. As a special bonus, the president of the company would like to send a note of
congratulations to employees each year on their hire month.

Copyright © 2021, SAS Institute Inc., Cary, North Carolina, USA. ALL RIGHTS RESERVED.
2.1 Investigating Data in SAS Visual Analytics 2-15

You need to access and investigate the data to determine which modifications need to be made to
satisfy these requirements.

Practice: Accessing and Investigating Data


This practice reinforces the concepts
discussed previously.

Copyright © 2021, SAS Institute Inc., Cary, North Carolina, USA. ALL RIGHTS RESERVED.
2-16 Lesson 2 Preparing Data Using SAS Data Studio

2.2 Transforming Data Using SAS Data


Studio

Business Scenario

24 cols

Rename
951,669 obs

CUSTOMERS
Delete
One row per
product ordered
Convert

During the Investigate phase, you discovered more information about the table that you’ll be using
for the Marketing project, the CUSTOMERS table.
This table contains a total of 951,669 observations and 24 columns. Each row represents a product
ordered by a customer, so there are multiple rows for each order and multiple rows for each
customer.
As you further investigated the table, you uncovered some data-cleansing operations that need to be
performed. You need to rename some columns, delete unnecessary columns, and convert IDs to
categories.

Copyright © 2021, SAS Institute Inc., Cary, North Carolina, USA. ALL RIGHTS RESERVED.
2.2 Transforming Data Using SAS Data Studio 2-17

Calculate

Profit Loyalty Member

35
30-44
45-59
Customer 60-74 Days to
Age Customer Delivery
Age Group

To perform the analysis, you also need to calculate a number of new data items: profit, customer
age, customer age group, loyalty member, and delivery times. Some of these items are calculated in
SAS Data Studio and others are calculated in Visual Analytics.

Copyright © 2021, SAS Institute Inc., Cary, North Carolina, USA. ALL RIGHTS RESERVED.
2-18 Lesson 2 Preparing Data Using SAS Data Studio

A description of the categories in the CUSTOMERS table is displayed below:

Name Description Distinct


Counts

City Name City where customer resides 10,507

Continent Name Continent where customer resides 5

Customer Birth Date Date on which customer was born 4,368

Customer Country Country where customer resides 47

Customer Group Name Loyalty member group 3

Customer Name Name of customer 67,806

Customer Type Name Loyalty member level 7

Customer ID Unique identifier for customer 68,300

Date Order was Delivered Date on which order was delivered to 1,840
customer

Date Order was placed by Customer Date on which order was placed by customer 1,825

Order Type Method in which the order was placed 3

Order ID Unique identifier for order 747,953

Postal code Postal code where customer resides 19,340

State Name State/province where customer resides 272

Note: By default, all datetime variables have a format of Date with Month Name.

A description of the measures in the CUSTOMERS table is displayed below:

Name Description Minimum Maximum Average Number


Missing

Cost Cost per unit 0.40 1,583.60 77.76 0

Discount in percent of Discount (% of normal 0.30 0.60 0.38 942,517


Normal Total Retail Price total retail price)

Quantity Ordered Quantity ordered 1.00 10.00 1.68 0

Retail Price Total revenue 0.63 9,385.80 139.96 0

Copyright © 2021, SAS Institute Inc., Cary, North Carolina, USA. ALL RIGHTS RESERVED.
2.2 Transforming Data Using SAS Data Studio 2-19

A description of the data changes for the CUSTOMERS table is displayed below:

Transform Description

Rename Retail Price represents total amount spent on products purchased (Total
Revenue)

Rename Cost represents cost per unit (Unit Cost)

Convert column Customer_ID to character (Customer ID (char))

Convert column Order_ID to character (Order ID)

Trim whitespace Trim leading and trailing whitespace on character Customer ID (char)

Trim whitespace Trim leading and trailing whitespace on character Order ID

Split Customer ID (char) to Customer ID and Loyalty Num (fixed width=5)

Remove Customer ID (char), Street_Name, xyContinentLat, xyContinentLon,


Employee_ID, Street_ID, Product_ID, Customer_ID, Order_ID

Calculated column Profit = Total Revenue - Unit Cost * Quanity

Calculated column Days to Delivery = Delivery_Date - Order_Date

Calculated column Loyalty Member from Loyalty Num (99 = Yes, 00 = No)

Calculated column Customer Age = Today's Date - Customer Birth Date/ 365.25

Calculated column Customer Age Group from Customer Age

Note: The actual calculations performed are more complex and are discussed in more detail in
later lessons.

Copyright © 2021, SAS Institute Inc., Cary, North Carolina, USA. ALL RIGHTS RESERVED.
2-20 Lesson 2 Preparing Data Using SAS Data Studio

Visual Analytics Methodology: Prepare


Prepare
• Splitting
• Using an expression
• Horizontally (joins)
• Using custom code
• Vertically (appends)
Correct data
quality issues

• Changing case of columns


• Changing data type or format Create new
Combine tables • Renaming columns columns
• Removing white space
• Standardizing
• Parsing
• Clustering

In the Prepare phase of the Visual Analytics methodology, you create the tables needed for analysis.
This can be done by combining tables, correcting data quality issues, and modifying existing data
items or creating new items.
If the data that you need currently exists in multiple tables, you can combine them together in this
phase. Tables can be combined horizontally (using joins) or vertically (using appends).
Also, in this phase, data quality issues can be corrected. These issues can be fixed by changing the
case of columns, changing the data type or format, renaming columns, removing white space, or
standardizing, parsing, or clustering the data.
In addition, you can also create new calculated columns in this phase by splitting, using an
expression, or using custom code.

Copyright © 2021, SAS Institute Inc., Cary, North Carolina, USA. ALL RIGHTS RESERVED.
2.2 Transforming Data Using SAS Data Studio 2-21

Prepare

CAS table Plan CAS table

Run now

Scheduled

You can use SAS Data Studio to prepare tables for Visual Analytics by creating plans that apply the
necessary transforms to the table. These plans can then be executed at any time or scheduled to
run periodically to create your analysis tables.

SAS Data Studio

SAS Data Studio

View metrics Loaded into CAS

Apply transforms

SAS Data Studio is the data preparation application in SAS Viya. Using SAS Data Studio, you can
view metrics about your tables and apply transforms to the tables by creating plans.
Before data can be prepared using SAS Data Studio, the table must first be loaded into CAS.

Copyright © 2021, SAS Institute Inc., Cary, North Carolina, USA. ALL RIGHTS RESERVED.
2-22 Lesson 2 Preparing Data Using SAS Data Studio

SAS Data Studio


View metrics

• Understand table structure


• Identify data quality issues
• Run on source and result
table
• Compare metrics over time
Table sample View table metadata

• See data values • Show column details


• View changes applied (type, length, format)
to table
View metrics

You can then view details about the table. You can see a sample of the columns and rows, generate
a profile of the table to view metrics, and view metadata information.
The table sample gives you an idea about the individual data values and can be used to view
changes applied to the table when transforms are added.
Profile metrics give you an idea about the structure of the table and can be used to identify data
quality issues. Profiles can be run on the source table and on the table created from the plan. You
can use these profiles to compare metrics over time to ensure that your data quality has improved.
Metadata information shows details about the columns, like the type, length, and format. This can be
used to understand your data at a high level.

Copyright © 2021, SAS Institute Inc., Cary, North Carolina, USA. ALL RIGHTS RESERVED.
2.2 Transforming Data Using SAS Data Studio 2-23

Question – Calculating Profit


Given the values for Quantity, Total Revenue, and Unit Cost, how would you
calculate Profit?

Quantity Total Revenue Unit Cost

1 $191.00 $160.90

4 $499.20 $107.20

1 $173.00 $145.50

1 $56.90 $51.90
4 $740.40 $155.40

Answer – Calculating Profit


Given the values for Quantity, Total Revenue, and Unit Cost, how would you
calculate Profit?

Quantity Total Revenue Unit Cost

1 $191.00 $160.90

4 $499.20 $107.20

1 $173.00 $145.50
1 $56.90 $51.90
4 $740.40 $155.40

Profit = Total Revenue - (Unit Cost * Quantity)

Copyright © 2021, SAS Institute Inc., Cary, North Carolina, USA. ALL RIGHTS RESERVED.
2-24 Lesson 2 Preparing Data Using SAS Data Studio

Question – Calculating Days to Delivery


Given the values for Order_Date and Delivery_Date, how would you calculate Days
to Delivery?
Order_Date Delivery_Date

27Jun2016 01Jul2016
31Mar2012 04Apr2012

26Feb2014 27Feb2014
08Nov2016 12Nov2016
17May2013 18May2013

Answer – Calculating Days to Delivery


Given the values for Order_Date and Delivery_Date, how would you calculate Days
to Delivery?
Order_Date Delivery_Date

Days to Delivery = Delivery_Date – Order_Date 27Jun2016 01Jul2016


31Mar2012 04Apr2012
26Feb2014 27Feb2014
In SAS, dates are stored as the number
08Nov2016 12Nov2016
of days since January 1, 1960.
17May2013 18May2013

Copyright © 2021, SAS Institute Inc., Cary, North Carolina, USA. ALL RIGHTS RESERVED.
2.2 Transforming Data Using SAS Data Studio 2-25

Preparing Data
This demonstration illustrates how
to view table and column profile
information and view plan actions
in SAS Data Studio.

Practice Scenario

24 cols

Rename
648 obs Filter

EMPLOYEES
Delete
One row per
employee
Convert
aa AA
Change case

During the Investigate phase in the practice, you discovered more information about the table that
you’ll use for the Human Resources project, the EMPLOYEES table.
This table contains a total of 648 observations and 24 columns. Each row represents a current or
past employee of Orion Star and contains salary information and summary information about that
employee’s sales accomplishments (the number of orders, the profit generated, and the quantity
sold).

Copyright © 2021, SAS Institute Inc., Cary, North Carolina, USA. ALL RIGHTS RESERVED.
2-26 Lesson 2 Preparing Data Using SAS Data Studio

As you investigated the table, you uncovered some changes that need to be made. You need to
rename some columns, delete unnecessary columns, change the case for Country, convert IDs to
category, and add a filter to include only employees in the Sales and Purchasing Departments.

Calculate

Employee
Group Employee
Tenure

Anniversary
Month Employee
Type

To perform the analysis, you also need to calculate a number of new data items: employee group,
anniversary month, employee tenure, and employee type. Some of these items are calculated in
SAS Data Studio and others are calculated in Visual Analytics.

Copyright © 2021, SAS Institute Inc., Cary, North Carolina, USA. ALL RIGHTS RESERVED.
2.2 Transforming Data Using SAS Data Studio 2-27

A description of the categories in the EMPLOYEES table is displayed below:

Name Description Distinct Counts

Company Company where employee works 12

Department Department where employee works 3

Employee Birth Date Date employee was born 604

Employee Country Country where employee resides (lowercase) 11

Employee Hire Date Date employee was hired 240

Employee ID Unique identifier for employee 648

Employee Name Name of employee 648

Employee Termination Date Date employee retired 62

Group Group where employee works 15

Job Title Job title of employee 9

Manager at 1. Level Identifier for manager of employee 18

Section Section where employee works 3

Note: By default, all datetime variables have a format of Date with Month.

A description of the measures in the EMPLOYEES table is displayed below:

Name Description Minimum Maximum Average Number


Missing

Annual Annual salary of employee, 20,835.00 40,755.00 27,595.90 1


Salary in dollars

Total Total number of customers to 1 187,420 1,154.25 0


Customers which employee made a sale

Total Total number of orders 1 186,636 1,152.80 0


Orders handled by employee

Total Total number of products 1 235,699 1,468.63 0


Products ordered from employee
Ordered

Total Profit Total profit generated from 11.10 19,146,779.62 109,148.07 0


orders handled by employee

Total Total quantity sold by 1 412,684 2,465 0


Quantity employee
Ordered

Copyright © 2021, SAS Institute Inc., Cary, North Carolina, USA. ALL RIGHTS RESERVED.
2-28 Lesson 2 Preparing Data Using SAS Data Studio

A description of the data changes for the EMPLOYEES table is displayed below:

Transform Description

Rename Manager_Level1 represents ID of manager (Manager ID)

Convert column Employee_ID to character (Employee ID)

Trim whitespace Trim leading and trailing whitespace on character Employee ID

Change chase Employee_Country to uppercase

Filter Department in Sales or Purchasing

Remove Employee_BirthDate, Manager_Levels, Manager_Level2, Manager_Level3,


Manager_Level4, Manager_Level5, Manager_Level6,
Total_Products_Ordered, Total_Quantity_Ordered, Total_Customers,
Section, Employee_ID

Calculated column Anniversary Month from Employee Hire Date (MONNAME format)

Calculated column Employee Tenure from Employee Hire Date:


Retired = (Employee Termination Date - Employee Hire Date) / 365.25
Active = (Today's Date - Employee Hire Date) / 365.25

Calculated column Employee Type from Employee Termination Date


(Retired =<missing>, Active = <not missing>)

Note: The actual calculations performed are more complex and are discussed in more detail in
later lessons.

Practice: Preparing Data


This practice reinforces the concepts
discussed previously.

Copyright © 2021, SAS Institute Inc., Cary, North Carolina, USA. ALL RIGHTS RESERVED.
Lesson 3 Analyzing Data Using
SAS Visual Analytics
3.1 Working with Data Items ........................................................................................................ 3-5

3.2 Exploring Data with Charts and Graphs ............................................................................. 3-11

3.3 Creating Data Items and Applying Filters .......................................................................... 3-22

3.4 Performing Data Analysis .................................................................................................... 3-49


3-2 Lesson 3 Analyzing Data Using SAS Visual Analytics

Copyright © 2021, SAS Institute Inc., Cary, North Carolina, USA. ALL RIGHTS RESERVED.
3.1 Working with Data Items 3-3

Introduction

Digital information
age

Discover trends
and relationships

Collect data

We are living in the digital information age. It is now easier than ever to collect data about every
aspect of our lives. However, having access to data is not the same as truly understanding the data
and using it effectively. You need to focus on the details to discover those trends and relationships
that will help you truly understand the intricacies of your data. This is probably the most difficult, but
most rewarding, step of working with data.

Copyright © 2021, SAS Institute Inc., Cary, North Carolina, USA. ALL RIGHTS RESERVED.
3-4 Lesson 3 Analyzing Data Using SAS Visual Analytics

Apply filters
Modifying
data items
Create data
items

Explore
data
Add
analytics

In this lesson, you learn how to analyze data using Visual Analytics. You start by modifying data
items for your analysis. Then, you explore your data with charts and graphs to help uncover hidden
relationships. Next, you create some data items that you need for the analysis and apply filters to
focus the analysis on a specific group. Finally, you add some analytics (like forecasting and fit lines)
to discover trends and patterns among data items.

Copyright © 2021, SAS Institute Inc., Cary, North Carolina, USA. ALL RIGHTS RESERVED.
3.1 Working with Data Items 3-5

3.1 Working with Data Items

Business Scenario
CUSTOMERS

$¥ Other changes

£€ Rename
Modify formats

Data View

Modify
aggregations

During the Investigate phase, you created a list of the data changes that are needed for the
CUSTOMERS table based on your assignment, which is to analyze profits for the Marketing team
and analyze delivery times for the Shipping team.
Some of the needed changes were applied by executing a plan that was created in SAS Data
Studio. However, some changes will need to be made in Visual Analytics.
You need to modify the formats and aggregations for some data items and rename some data items.
After you make these changes, you will create a data view (or a template of the changes) that can
be used with this table in the future.
In addition, you might discover other changes that need to be made as you perform your analysis
(like creating new data items and adding filters).

Copyright © 2021, SAS Institute Inc., Cary, North Carolina, USA. ALL RIGHTS RESERVED.
3-6 Lesson 3 Analyzing Data Using SAS Visual Analytics

SAS Visual Analytics Methodology: Analyze


Analyze

Discover
Create data
patterns
items Discover
trends
Create
Add filters models
Modify
Explore
properties
relationships

In the Analyze phase of the Visual Analytics methodology, you explore the data to identify any
patterns, relationships, and trends that might exist.
During this phase, you might need to make changes to the data items for your analysis. This can
consist of modifying data item properties (like the names, formats, and aggregations), creating new
data items, and applying filters that are needed for the analysis.
Then, after the data meets your specifications, you can begin to explore relationships using charts
and graphs and discover trends and patterns with analytics. Lastly, you can create, test, and
compare models on the patterns that you discovered using SAS Visual Statistics and SAS Visual
Data Mining and Machine Learning.

Copyright © 2021, SAS Institute Inc., Cary, North Carolina, USA. ALL RIGHTS RESERVED.
3.1 Working with Data Items 3-7

SAS Data Studio versus SAS Visual Analytics

SAS Visual Analytics


SAS Data Studio

SAS Cloud Analytic Services


(CAS)
SAS Visual Analytics App

Data View

Remember that SAS Data Studio uses a CAS table as input and creates a CAS table as output from
the plan.
Alternatively, SAS Visual Analytics uses a CAS table as input and creates a report that can be
viewed in Visual Analytics or the SAS Visual Analytics app. Any changes that are made to data items
in Visual Analytics are applied to the report only and do not affect the CAS table.
However, beginning with Visual Analytics 8.3, report data views can be created to save and apply
data changes for a CAS table.

Copyright © 2021, SAS Institute Inc., Cary, North Carolina, USA. ALL RIGHTS RESERVED.
3-8 Lesson 3 Analyzing Data Using SAS Visual Analytics

Data View

Geography
Data property data items
changes

Data filters

Calculated items

Hierarchies

A data view acts as a template for any data settings that are modified, including data property
changes (formats, names, aggregations, types), data filters, hierarchies, geography data items, and
calculated items. These views can be applied to the data source when you create reports and can be
shared with others. This means that you spend less time preparing the data and more time analyzing
the data.

Working with Data Items

This demonstration illustrates how


to modify data item properties
(name, format, aggregation) in
Visual Analytics.

Copyright © 2021, SAS Institute Inc., Cary, North Carolina, USA. ALL RIGHTS RESERVED.
3.1 Working with Data Items 3-9

Practice Scenario
EMPLOYEES

Other changes

$ ¥ View table Rename


£€
Modify formats
Modify
classifications

During the Investigate phase in the practice, you created a list of data changes that are needed for
the EMPLOYEES table based on your assignment, which is analyzing salaries to determine the
employees that are eligible for promotion.
Some of the needed changes were applied by executing a plan that was created in SAS Data
Studio. However, some changes will be made in Visual Analytics.
You need to view the new table, modify the classifications (types) and formats for some data items,
and rename some data items.
In addition, you might discover other changes that need to be made as you perform your analysis
(like creating new data items and applying filters).

Copyright © 2021, SAS Institute Inc., Cary, North Carolina, USA. ALL RIGHTS RESERVED.
3-10 Lesson 3 Analyzing Data Using SAS Visual Analytics

Practice: Working with Data Items


This practice reinforces the concepts
discussed previously.

Copyright © 2021, SAS Institute Inc., Cary, North Carolina, USA. ALL RIGHTS RESERVED.
3.2 Exploring Data with Charts and Graphs 3-11

3.2 Exploring Data with Charts and


Graphs

Business Scenario

Marketing

Range of profits

Focus group

Order Type
Continent

For your assignment, the Marketing team asked for an analysis of profits. They are interested in
selecting a focus group for the next marketing campaign.
As a first step, you want to understand the range of profits that were generated from the customers
of Orion Star.
In addition, you are interested in the total profits that were produced from each order type (Internet,
Retail, and Catalog) and by continent.

Copyright © 2021, SAS Institute Inc., Cary, North Carolina, USA. ALL RIGHTS RESERVED.
3-12 Lesson 3 Analyzing Data Using SAS Visual Analytics

Activity – Viewing Automated Explanation


Sign in to SAS Viya.
Open the VA1- Activity3.01 report (in the /Courses/YVA1 folder).
1. What is the average of Days to Delivery?
2. Which factor is the most related to Days to Delivery?
3. Which country has the highest average for Days to Delivery?

This report uses an automated explanation object to explore Days to Delivery. The automated
explanation object determines the most important underlying factors for a specific response variable.
For more information about the automated explanation object, see “Working with Automated
Explanation Objects” in the SAS Visual Analytics: Working with Report Content documentation.
Note: The automated explanation object is discussed in more detail in the SAS Visual Analytics 2
for SAS Viya: Advanced course.

Answer – Viewing Automated Explanation


What is the average of Days to Delivery?
1.1

Which factor is the most related to Days to Delivery?


Order Type

Which country has the highest average for Days to Delivery?


Serbia

Copyright © 2021, SAS Institute Inc., Cary, North Carolina, USA. ALL RIGHTS RESERVED.
3.2 Exploring Data with Charts and Graphs 3-13

Descriptive Graphs

• View variability and


extreme values

Box plot
Histogram

• View distribution of a single


measure
• Gauge overall range
• Identify values with a high
number of observations
• Determine normality Bar chart

Typically, the first part of the Analyze phase is gaining a better understanding of your data items in
broad terms (that is, understanding the ranges of values and totals for specific groups or subgroups).
This can be accomplished with descriptive graphs (for example, histograms, box plots, and bar
charts).
Histograms can be used to view the distribution of a single measure. A histogram consists of a series
of bars where the height represents the number of observations that fit in a specific range.
Histograms are ideal for gauging the overall range of a measure and for identifying values that
contain a high number of observations. Histograms can also be used to determine whether a
measure is normally distributed, which can be very helpful in modeling.
Alternatively, box plots can be used to view information about the variability and extreme values of a
measure for distinct values of a category data item.

Copyright © 2021, SAS Institute Inc., Cary, North Carolina, USA. ALL RIGHTS RESERVED.
3-14 Lesson 3 Analyzing Data Using SAS Visual Analytics

Outliers

Box plot 1.5*Interquartile range Maximum


75th percentile

Mean
Median

25th percentile
Minimum

In the box plot, the size and location of the box indicate the range of values between the 25th and
75th percentile (interquartile range) for that group. The diamond marker indicates the mean value,
and the line inside the box indicates the median value. You can also modify the options to display
outliers in the plot. Outliers are data points whose distances from the interquartile range are more
than 1.5 times the size of the interquartile range. The whiskers can indicate either the minimum and
maximum values or the range of values that are outside the interquartile range but close enough to
not be considered outliers. If there are many outliers, the range of values is shown as a bar that is
colored to represent the number of values within that range (as seen here).

Copyright © 2021, SAS Institute Inc., Cary, North Carolina, USA. ALL RIGHTS RESERVED.
3.2 Exploring Data with Charts and Graphs 3-15

• View variability and


extreme values
• Determine differences
between groups
Box plot

Histogram
• Compare summarized
• View distribution of a single data
measure • Compare nominal
• Gauge overall range values
• Identify values with a high • Show time series data Bar chart
number of observations • Show rankings
• Determine normality • Show parts of a whole

Box plots are extremely useful for determining the differences between groups.
Another excellent way to view differences is using bar charts to compare summarized data. Bar
charts display aggregated data for the distinct values of a category. They are probably one of the
most versatile, and most used, graphs available. Bar charts can be used to compare nominal values
(categories that have no particular order), show time series data, show rankings (like the top or
bottom values), and show parts of a whole.

Question – Choosing a Graph


Which graph would help you determine whether a measure is normally distributed?
a. distribution plot
b. box plot
c. histogram
d. normality plot

Copyright © 2021, SAS Institute Inc., Cary, North Carolina, USA. ALL RIGHTS RESERVED.
3-16 Lesson 3 Analyzing Data Using SAS Visual Analytics

Answer – Choosing a Graph


Which graph would help you determine whether a measure is normally distributed?
a. distribution plot
b. box plot
c. histogram
d. normality plot

Exploring Data - Part 1


This demonstration illustrates how to use
the automatic chart to explore data and
modify roles and options for charts and
graphs in Visual Analytics.

Copyright © 2021, SAS Institute Inc., Cary, North Carolina, USA. ALL RIGHTS RESERVED.
3.2 Exploring Data with Charts and Graphs 3-17

Practice Scenario

Human Resources

Range of salaries

Promotions

Job title

Department

For your practice assignment, the Human Resources team has asked for an analysis of salaries to
determine which employees could be eligible for promotion.
As a first step, you want to understand the range of salaries at Orion Star. In addition, you are
interested in viewing total salaries by job title and department.

Practice: Exploring Data - Part 1


This practice reinforces the concepts
discussed previously.

Copyright © 2021, SAS Institute Inc., Cary, North Carolina, USA. ALL RIGHTS RESERVED.
3-18 Lesson 3 Analyzing Data Using SAS Visual Analytics

Business Scenario

Marketing

Retail
Profits
$$$
Internet
$$$
Europe $
Catalog

$ North
$ America

During the previous analysis, you discovered that more than 20% of products that were ordered
generated a loss, which is affecting the profitability of the company.
To reduce costs, management decided that the company should try to increase sales through the
low-cost channels—namely, the internet and catalog. However, you discovered that total profits were
lower for these channels. You will continue to analyze profits by order type to determine ways that
Orion Star can attempt to improve profits through those channels.
You also discovered that profits were lower in North America than in Europe. This was a strange
discovery because Orion Star is headquartered and based in the United States. To better understand
why this discrepancy exists, you will continue to analyze profits by location to determine how to
improve profits in non-European countries.

Copyright © 2021, SAS Institute Inc., Cary, North Carolina, USA. ALL RIGHTS RESERVED.
3.2 Exploring Data with Charts and Graphs 3-19

Exploring Data - Part 2


This demonstration illustrates how
to use box plots to explore data in
Visual Analytics.

Copyright © 2021, SAS Institute Inc., Cary, North Carolina, USA. ALL RIGHTS RESERVED.
3-20 Lesson 3 Analyzing Data Using SAS Visual Analytics

Practice Scenario

Human Resources

$$
Salaries

$ Sales Rep II

$25K - $30K
Sales Rep I
$$$

Sales Rep III

During the previous practice analysis, you discovered that most salaries are within the $25,000 to
$30,000 range. Management has determined that these salaries are not competitive in the market.
They are worried about losing good employees to competitors.
Because Orion Star had a great sales year, management decided to promote some employees.
They believe the biggest impact will come by promoting employees with the lowest salaries.
You will continue to analyze salary costs by job title to determine which job title has the lowest
average salary. This will help you create a list of employees that might qualify for a promotion.

Copyright © 2021, SAS Institute Inc., Cary, North Carolina, USA. ALL RIGHTS RESERVED.
3.2 Exploring Data with Charts and Graphs 3-21

Practice: Exploring Data - Part 3


This practice reinforces the concepts
discussed previously.

Copyright © 2021, SAS Institute Inc., Cary, North Carolina, USA. ALL RIGHTS RESERVED.
3-22 Lesson 3 Analyzing Data Using SAS Visual Analytics

3.3 Creating Data Items and Applying


Filters

Business Scenario

Marketing
Profits

Continent
Loyalty Member
30-44
45-59
60-74

Customer
Order Type Age Group

In the previous analysis, you discovered higher total profits for retail sales compared to the other
channels. You need to determine why total profits are so much higher for retail sales. Is it because
there are more customers who shop retail? Are more orders placed through that channel, or is there
some other reason?
You also need to begin creating a focus group of customers for the next marketing campaign. You
can start by looking at which locations produce the highest average profit for the internet and catalog
channels. This will give you a good idea about where to start the campaign.
In addition, you will analyze average profits by loyalty member and age group to determine whether
there are any noticeable differences.
To perform this analysis, you will need to create several new data items.

Copyright © 2021, SAS Institute Inc., Cary, North Carolina, USA. ALL RIGHTS RESERVED.
3.3 Creating Data Items and Applying Filters 3-23

Types of Calculated Items


Custom category Geography Aggregated

Hierarchy
Duplicate Distinct count

15

Calculated Parameters Derived items

As part of the Investigate phase, you created a list of data items that need to be calculated for the
analysis. Some of these data items were created in SAS Data Studio, but some still need to be
calculated.
In Visual Analytics, you can create many types of data items to aid your analysis or for use in your
reports.

Copyright © 2021, SAS Institute Inc., Cary, North Carolina, USA. ALL RIGHTS RESERVED.
3-24 Lesson 3 Analyzing Data Using SAS Visual Analytics

Calculated Items versus Aggregated Measures

Calculated Aggregated

15

• Mathematical calculations on
numeric values
• Operations on datetime data
items or categories
• Calculations performed on
unaggregated data

In Visual Analytics, two types of calculated items can be created: calculated data items and
aggregated measures.
Calculated data items are created by performing mathematical calculations on numeric values or by
performing operations on datetime data items or categories. All calculations are performed on
unaggregated data. That is, the expression is evaluated for each row in the data source.

Calculated

New Salary = (Salary * Increase)

Country Salary Increase

US 40,000 1.05
UK 65,000 1.10

UK 32,000 1.05
US 80,000 1.10

UK 56,000 1.15

Copyright © 2021, SAS Institute Inc., Cary, North Carolina, USA. ALL RIGHTS RESERVED.
3.3 Creating Data Items and Applying Filters 3-25

For example, you can create a new calculated item (New Salary) by multiplying Salary and
Increase. For each row in the data source, the operation is evaluated, …

Calculated

New Salary = (Salary * Increase)

Country Salary Increase New Salary

US 40,000 1.05 42,000


UK 65,000 1.10 71,500 US = $130,000
UK 32,000 1.05 33,600
US 80,000 1.10 88,000
UK = $169,500
UK 56,000 1.15 64,400

… and the new data item is created. Then, when that data item is used in a graph (for example, with
Country), the values for New Salary are totaled for each country.

Copyright © 2021, SAS Institute Inc., Cary, North Carolina, USA. ALL RIGHTS RESERVED.
3-26 Lesson 3 Analyzing Data Using SAS Visual Analytics

Calculated

Aggregated

• Mathematical calculations on 15

numeric values
• Operations on datetime data
items or categories
• First aggregate values and
• Calculations performed on
then perform the operation
unaggregated data
• Calculation changes
depending on other data
items used

Conversely, aggregated measures enable you to use aggregated values to calculate new data items.
These data items are created by first aggregating values and then performing the operation. With
aggregated measures, the calculation changes depending on other data items that are available in
the graph.

Aggregated

15 Salary (Percent of total) =


Sum[_ByGroup_](Salary) / Sum[_ForAll_](Salary)

Country Salary
US 40,000 Country Salary
UK 65,000 US 120,000

UK 32,000 UK 153,000

US 80,000

UK 56,000

For example, you can create a new aggregated measure (Salary (Percent of total)) by dividing the
sum of the salary for each group by the sum of the salary for all groups. In this instance, because
Salary (Percent of total) is paired with Country, salaries are first totaled for each country.

Copyright © 2021, SAS Institute Inc., Cary, North Carolina, USA. ALL RIGHTS RESERVED.
3.3 Creating Data Items and Applying Filters 3-27

Aggregated

15 Salary (Percent of total) =


Sum[_ByGroup_](Salary) / Sum[_ForAll_](Salary)

Country Salary
US 40,000 Country Salary
UK 65,000 US 120,000
UK 153,000 US = 43.96%
UK 32,000
TOTAL 273,000
US 80,000
UK = 56.04%
UK 56,000

Next, salaries are totaled for all countries. Then, the operation is evaluated for each country to show
the contribution to total salary.
You could take the same aggregated measure and pair it with Job Title to see the contribution of
each job title to total salary. The dynamic nature of aggregated measures makes them extremely
useful for analysis and reporting.

Question – Type of Calculation


Match each new data item with the type of calculation.
___ Gross Profit Margin (Total Profit/ Total Revenue)

___ Date (from month, day, year)

___ Hemisphere (from continents) A. calculated item

___ GDP Growth (year-over-year) B. aggregated measure

___ Number of Employees (distinct count)

___ State Abbreviations (uppercase)

Copyright © 2021, SAS Institute Inc., Cary, North Carolina, USA. ALL RIGHTS RESERVED.
3-28 Lesson 3 Analyzing Data Using SAS Visual Analytics

Answer – Type of Calculation


Match each new data item with the type of calculation.
_B_ Gross Profit Margin (Total Profit/ Total Revenue)

_A_ Date (from month, day, year)

_A_ Hemisphere (from continents) A. calculated item

_B_ GDP Growth (year-over-year) B. aggregated measure

_B_ Number of Employees (distinct count)

_A_ State Abbreviations (uppercase)

Custom Categories

Custom category • Creates labels for groups of


categories or measures
• Can use calculated items
• Is easier to create

Sometimes, you might need to create labels for groups of category or measure data items. This can
be accomplished with calculated items.
However, custom categories can do the same thing but are a bit easier to create.

Copyright © 2021, SAS Institute Inc., Cary, North Carolina, USA. ALL RIGHTS RESERVED.
3.3 Creating Data Items and Applying Filters 3-29

Custom category Calculated item

Measure

Custom category

When you create a custom category from a measure data item, you can use intervals or distinct
values to group the data.
For example, you can create a custom category that shows discount ranges by assigning labels to
ranges of discount values. The same grouping could be accomplished with a calculated item, but the
expression is much more complex.

Copyright © 2021, SAS Institute Inc., Cary, North Carolina, USA. ALL RIGHTS RESERVED.
3-30 Lesson 3 Analyzing Data Using SAS Visual Analytics

Custom category

Category

Custom category

Calculated item

When you create a custom category from a category data item, you can use distinct values to group
the data.
For example, you can create a custom category that groups continents into hemispheres. Again, the
same grouping could be accomplished with a calculated item, but it is a bit more difficult to
implement.

Question – Calculating Customer Age


Given the values of Customer Birth Date and today’s date, how would you calculate
Customer Age?
Customer
Birth Date
02Jan1983
28May1975

08May2008
19Sep2010

10Oct2017

Copyright © 2021, SAS Institute Inc., Cary, North Carolina, USA. ALL RIGHTS RESERVED.
3.3 Creating Data Items and Applying Filters 3-31

Answer – Calculating Customer Age


Given the values of Customer Birth Date and today’s date, how would you calculate
Customer Age?
Customer
In SAS, dates are stored as the number of days since Birth Date
January 1, 1960: 02Jan1983
Customer Age = (Today – Customer Birth Date)/365.25 28May1975

08May2008

19Sep2010

10Oct2017

Copyright © 2021, SAS Institute Inc., Cary, North Carolina, USA. ALL RIGHTS RESERVED.
3-32 Lesson 3 Analyzing Data Using SAS Visual Analytics

Calculating Customer Age

Round down to
nearest integer Date variable

Convert to date

Current date and time

One data item that is needed for your analysis is Customer Age. Ages are best calculated in Visual
Analytics because you can use operators to ensure that they are updated each time that a report is
opened.
To calculate Customer Age, you can use the expression shown here.
The Now operator creates a datetime value. It uses the current date and time, where the current
date and time is evaluated every time that you view the report.
The DatePart operator then converts that datetime value to a date value.
Then Customer Birth Date (a date variable) is subtracted from the current date to return the age of
the person in days.
To convert to years, this number is divided by 365.25.
Because people often don’t state their ages in decimals (35.4), the Floor operator is used to round
the number down to the nearest integer (35).
This type of calculation can also be used to calculate the age of a company, tenure (or the length of
time at a company), or the number of years between two dates.

Copyright © 2021, SAS Institute Inc., Cary, North Carolina, USA. ALL RIGHTS RESERVED.
3.3 Creating Data Items and Applying Filters 3-33

Creating Data Items


This demonstration illustrates how to create
new data items (distinct counts, custom
categories) in Visual Analytics.

Copyright © 2021, SAS Institute Inc., Cary, North Carolina, USA. ALL RIGHTS RESERVED.
3-34 Lesson 3 Analyzing Data Using SAS Visual Analytics

Practice Scenario

Human Resources

Active

Salaries
$
Retired
Years of
Service
Sales Rep I

In the previous practice analysis, you discovered lower average salary costs for employees with the
Sales Rep I job title. Because these salaries are significantly below equivalent positions in the
market, this seems like a good place to initiate promotions.
Management decided that they would also like to consider loyalty as a factor in promotions. They
would like you to analyze years of service by job title to determine eligibility for promotion. In
addition, they noted that some employees in the list are retired and no longer work for the company.
They want to see this analysis by status (active versus retired).
To perform this analysis, you need to create some new data items.

Copyright © 2021, SAS Institute Inc., Cary, North Carolina, USA. ALL RIGHTS RESERVED.
3.3 Creating Data Items and Applying Filters 3-35

Question – Calculating Years of Service


Given the values of Employee Hire Date and
Employee Termination Date, how would Employee Employee
you calculate Years of Service? Hire Date Termination Date
01Dec2004 28Feb2007
01Nov2005 .

25Jan2005 .
01Mar2005 28Feb2010

31May2005 31May2012

11Dec2005 .

01Sep2002 .

Answer – Calculating Years of Service


Given the values of Employee Hire Date and
Employee Termination Date, how would Employee Employee
you calculate Years of Service? Hire Date Termination Date
01Dec2004 28Feb2007
Active employees: 01Nov2005 . Active
YOS = (Today – Employee Hire Date)/365.25
25Jan2005 . Retired
Retired employees: 01Mar2005 28Feb2010
YOS= (Employee Termination Date –
31May2005 31May2012
Employee Hire Date)/365.25
11Dec2005 .
Use the IF-ELSE operator to perform different 01Sep2002 .
calculations based on a condition.

Copyright © 2021, SAS Institute Inc., Cary, North Carolina, USA. ALL RIGHTS RESERVED.
3-36 Lesson 3 Analyzing Data Using SAS Visual Analytics

Practice: Creating Data Items


This practice reinforces the concepts
discussed previously.

Activity – Creating Periodic Data Items


Sign in to SAS Viya.
Open the VA1- Activity3.06 report (in the /Courses/YVA1 folder).
• For Profit, create a new calculation that calculates the difference from the
previous period.
Hint: On the Data pane, right-click Profit and select New calculation.
• Add the new aggregated measure to the crosstab.

1. What type of difference is calculated for each value of Order Month in the
crosstab?
2. What type of difference is calculated for Total in the crosstab?
3. Which operator is used to calculated the aggregated measure?

Copyright © 2021, SAS Institute Inc., Cary, North Carolina, USA. ALL RIGHTS RESERVED.
3.3 Creating Data Items and Applying Filters 3-37

Answer – Creating Periodic Data Items


1. What type of difference is calculated for each value of Order Month in the
crosstab?
Difference from previous month or a one-month change in Profit

2. What type of difference is calculated for Total in the crosstab?


Difference from previous year or a one-year change in Profit

3. Which operator is used to calculated the aggregated measure?


RelativePeriod

Copyright © 2021, SAS Institute Inc., Cary, North Carolina, USA. ALL RIGHTS RESERVED.
3-38 Lesson 3 Analyzing Data Using SAS Visual Analytics

Business Scenario

Marketing
Profits

Create geography
data items
North America
Internet

Create a hierarchy
Catalog Add a filter

Based on your previous analysis, management decided that the initial marketing strategy should
focus on increasing sales among North American customers who order through the catalog and the
internet. They feel that this will have the most substantial impact on increasing profitability. If this
initial campaign is successful, then the company can extend it to other locations and sales channels.
To start scoping the campaign, the Marketing team asked how profits are distributed throughout the
United States. Particularly, they are interested to see whether any clusters of areas with high profits
can be identified and used for the campaign.
To perform this analysis, you need to create some geography data items for mapping, create a
hierarchy to view customers by different locales (state and postal code), and add a filter to focus on
the United States.

Copyright © 2021, SAS Institute Inc., Cary, North Carolina, USA. ALL RIGHTS RESERVED.
3.3 Creating Data Items and Applying Filters 3-39

Filtering Data

Report
Detail report filters Designer

Summary report filters

Basic Advanced
Data source
• Local filter Post-aggregate
• Global filter • Subsets individual
• Subsets entire report report objects • Subsets using aggregated
• Applied to each object values
that uses data source • Aggregated values evaluated
• Acts as a pre-filter in the report object

Many types of filters can be created to subset data in Visual Analytics. In general, these filters are
split between those that can be modified by only the report designer and those that can also be
modified by the report viewer. In this lesson, we focus on filters that can be modified by the report
designer.
These filters can be classified into two types: detail report filters and summary report filters. Detail
report filters look at the individual values for data items, but summary report filters look at the
aggregated, or total, values.
Detail report filters can be split between those that are applied at a global level (data source) and
those that are applied at a local level (basic and advanced).
At the global level, a data filter can be added to subset the entire report. This filter is applied to every
object that uses the data source. It acts as a pre-filter by filtering the data before it is brought into
Visual Analytics. This can be seen in the updated cardinality values in the Data pane after the filter is
applied.
At the local level, basic and advanced report filters can be added to subset individual report objects.
The basic report filter subsets the object using a single data item, whereas the advanced report filter
subsets the object using any number of data items and operators in the same expression.
Each of these local filters subsets the data using detail data or individual values for data items.
The post-aggregate report filter subsets the report object using aggregated values, not individual
values. These aggregated values are evaluated in the report object and are used to specify the
minimum and maximum values in the selectable range.
Filters can be very helpful to focus on anomalies or inconsistencies that are discovered during
analysis.

Copyright © 2021, SAS Institute Inc., Cary, North Carolina, USA. ALL RIGHTS RESERVED.
3-40 Lesson 3 Analyzing Data Using SAS Visual Analytics

Geography Graphs

Coordinate
Region-Coordinate
Contour
Region

Network Line-Coordinate
Line

When location is a critical component of your analysis, geo maps can be very helpful. A geo map
overlays data on a geographic map. Five different types of geo maps can be created in Visual
Analytics: region, coordinate, region-coordinate, contour, and network.

Copyright © 2021, SAS Institute Inc., Cary, North Carolina, USA. ALL RIGHTS RESERVED.
3.3 Creating Data Items and Applying Filters 3-41

Region Coordinate

• Choropleth maps • Dot distribution or


• Use color to show dot density maps
variations by location • Scatter plot or
• Larger regions bubble plot
emphasized more • Detect spatial patterns
• Understand distribution

Region maps (also known as choropleth maps) use colors to show variations by location. With
region maps, larger regions seem more emphasized than smaller ones, which can skew your
analysis.
Coordinate maps (also known as dot distribution maps or dot density maps) display a map with
either a scatter plot or a bubble plot of coordinates. This type of map helps with detecting spatial
patterns and understanding the distribution of data over a geographic region. These maps use
clustered points to help reveal patterns.

Copyright © 2021, SAS Institute Inc., Cary, North Carolina, USA. ALL RIGHTS RESERVED.
3-42 Lesson 3 Analyzing Data Using SAS Visual Analytics

Even distribution

• Geo region or coordinate Uneven distribution


maps with scatter plot
• Geo coordinate maps with
bubble plot
• Size compares regions
without distortions
• Overlapping bubbles can
be difficult to see

Geo region or coordinate maps with a scatter plot should be used only when there is an even
distribution of values within each region. Alternatively, geo coordinate maps with a bubble plot can be
used even when data is not evenly distributed.
This is because the bubble plot can compare two measures. One is used for the size of the bubble,
and one is used for the color of the bubble. Bubble plots also have another advantage over region
maps. The bubble size helps with comparing regions without the size of the region itself causing
distortions. Sometimes, however, the size of the bubble can overlap with other bubbles, making the
chart difficult to read.

Copyright © 2021, SAS Institute Inc., Cary, North Carolina, USA. ALL RIGHTS RESERVED.
3.3 Creating Data Items and Applying Filters 3-43

Contour

• Display shaded regions


• Show very dense data
Region-Coordinate

• Use colored regions


Network
and coordinates
• Compare two levels of • Network diagram overlaid
data (general and on a map
specific) • Understand how location
affects relationships

Region-coordinate maps can display a map using both colored regions and coordinates. This type of
map is great for comparing two levels of data. The region colors represent more general information
(like countries), and the coordinates represent more specific information (like customer locations).
Contour maps display shaded regions over a geographic region. These are best used to show very
dense data.
Network maps show a network diagram overlaid on a map. These can be helpful for understanding
how location affects the relationships in the network.

Copyright © 2021, SAS Institute Inc., Cary, North Carolina, USA. ALL RIGHTS RESERVED.
3-44 Lesson 3 Analyzing Data Using SAS Visual Analytics

Latitude and
longitude in data

Geographic name
or code lookup

Latitude
Longitude
Country names
or codes
State or province Geographic data
names or ID values provider

US state names
or abbreviations US postal codes

When you create geo maps, a geography data item is needed. A geography data item is a category
whose values are mapped to geographic locations or regions. Geography data items can be created
using geographic name or code lookup, latitude and longitude in data, or a geographic data provider.

Question – Geography Data Items


Which object can use a data item that has a classification type
of geography? (Select all that apply.)
a. crosstab
b. geo map
c. table
d. bar chart

Copyright © 2021, SAS Institute Inc., Cary, North Carolina, USA. ALL RIGHTS RESERVED.
3.3 Creating Data Items and Applying Filters 3-45

Answer – Geography Data Items


Which object can use a data item that has a classification type
of geography? (Select all that apply.)
a. crosstab
b. geo map
c. table
d. bar chart

All these graphs can use a data item that has a classification type of geography.
The geo map requires it.

Hierarchy
What Is a Hierarchy?

Year 2017

Quarter 1 2 3 4

Jan Apr Jul Oct

Month Feb May Aug Nov

Mar Jun Sep Dec

A hierarchy is a defined arrangement of category data items based on a parent-child relationship. In


many cases, the levels of the hierarchy are arranged with more general information at the top (Year)
and more specific information at the bottom (Month).
Hierarchies enable you to add drill-down functionality to graphs and tables. Hierarchies that consist
of all geographic data items are considered geographic hierarchies and can be used in geo maps.

Copyright © 2021, SAS Institute Inc., Cary, North Carolina, USA. ALL RIGHTS RESERVED.
3-46 Lesson 3 Analyzing Data Using SAS Visual Analytics

Applying Filters
This demonstration illustrates how to
create new data items (geographic data
items, hierarchies) and apply filters in
Visual Analytics.

Copyright © 2021, SAS Institute Inc., Cary, North Carolina, USA. ALL RIGHTS RESERVED.
3.3 Creating Data Items and Applying Filters 3-47

Practice Scenario

Human Resources

Profit
Generated

Active Add a filter


Create geography
Sales data item

Based on your previous practice analysis, Management decided that the initial promotion analysis
should focus on active employees in the Sales Department. They feel that this will have the most
substantial impact on employee retention. If this initial series of promotions is successful, then the
company can extend it to other departments.
To start scoping the promotions, the Human Resources team has identified the amount of profit
generated by employee as one possible criterion for promotion. Given this condition, you need to
identify where the initial promotions should begin (that is, determine which countries generate the
most profit).
To perform this analysis, you need to add a filter to subset for the group identified (active employees
in the Sales Department) and create a geography data item for mapping.

Copyright © 2021, SAS Institute Inc., Cary, North Carolina, USA. ALL RIGHTS RESERVED.
3-48 Lesson 3 Analyzing Data Using SAS Visual Analytics

Practice: Applying Filters


This practice reinforces the concepts
discussed previously.

Copyright © 2021, SAS Institute Inc., Cary, North Carolina, USA. ALL RIGHTS RESERVED.
3.4 Performing Data Analysis 3-49

3.4 Performing Data Analysis

Business Scenario

Delivery
times Loyalty member
Order type
Number of
orders
30-44
45-59
60-74

Profits Customer
age group

Shipping Marketing

Based on your previous analysis, the Shipping team suggested that delivery times could be
responsible for lower total profits on the internet and catalog channels. After all, if you buy something
in a retail store, you get it immediately, but for both the internet and catalog, it takes time to receive
your purchase. They asked you to see whether there is a relationship between delivery times,
number of orders, and profits.
In addition, the Marketing team asked for help with identifying the focus group for the next marketing
campaign. Specifically, they want you to look at order types, loyalty members, and age groups to try
to select the focus group.

Copyright © 2021, SAS Institute Inc., Cary, North Carolina, USA. ALL RIGHTS RESERVED.
3-50 Lesson 3 Analyzing Data Using SAS Visual Analytics

Analysis Graphs: Bubble Plots and Treemaps

Bubble plot

• Display three dimensions Treemap


for a group
• Two measures = location • Display a lot of information
• Third measure = size in a small space
• Animated to show changes • Compare two measures for
over time a group

As part of your analysis, you might be interested in viewing differences between groups. This can be
accomplished with analysis graphs like bubble plots and treemaps.
Bubble plots are useful for displaying three dimensions of data (horizontal location, vertical location,
and size of bubble) for some group of category values. A bubble plot compares at least three
measures by using markers (bubbles) of varying sizes in a scatter plot. The values of two measures
determine the location of the bubble in the plot, and the value of the third measure determines the
size of the bubble. Bubble plots can also be animated to show changes in data over time. For
animated bubble plots, you want to focus on bubbles that act differently than others (for example,
bubbles that are stationary while others are moving or bubbles that are moving in a different direction
from the rest of the group).
Conversely, treemaps can be used to display lots of information in a small amount of space.
Treemaps can compare two measures for some group of category values. The value of the category
is represented by tiles, and measures can be added to both size and color the tiles. Typically, the
size and color are used to draw attention to areas of interest (for example, top contributors). The
measures that are used should mean something when they are compared, but they should not be
the same.

Copyright © 2021, SAS Institute Inc., Cary, North Carolina, USA. ALL RIGHTS RESERVED.
3.4 Performing Data Analysis 3-51

Analyzing Data
This demonstration illustrates how
to analyze data with graphs in Visual
Analytics.

Copyright © 2021, SAS Institute Inc., Cary, North Carolina, USA. ALL RIGHTS RESERVED.
3-52 Lesson 3 Analyzing Data Using SAS Visual Analytics

Practice Scenario

Human Resources

Company

Job title
Loyalty
Performance
Employee
group

Based on your previous practice analysis, the Human Resources team suggested that promotion
criteria be based on company loyalty and performance. Specifically, they think employees who have
been with the company longer and those who have generated higher profits should be promoted.
They asked you to identify the companies, job titles, and groups of employees that meet these
criteria and that will have the greatest impact (in other words, the groups with the largest number of
employees).
To perform this analysis, you need to create a hierarchy of the specified groups (company, job title,
and employee group).

Copyright © 2021, SAS Institute Inc., Cary, North Carolina, USA. ALL RIGHTS RESERVED.
3.4 Performing Data Analysis 3-53

Practice: Analyzing Data


This practice reinforces the concepts
discussed previously.

Copyright © 2021, SAS Institute Inc., Cary, North Carolina, USA. ALL RIGHTS RESERVED.
3-54 Lesson 3 Analyzing Data Using SAS Visual Analytics

Business Scenario

Marketing

Delivery
times

Discounts Total revenue Predict profit and


number of orders

Unit costs

To complete your analysis, management has asked that you analyze the relationship between
delivery times, discounts, total revenue, and unit costs. Specifically, they are interested in
determining whether these other measures could have an impact on profits and should be
considered.
In addition, they have asked that you determine the relationship between profits and number of
orders to try to predict how these trends will continue in the future. Do we get higher profits when the
number of orders increases? If so, we can try to focus our marketing campaign on increasing orders
to try to improve profitability.

Copyright © 2021, SAS Institute Inc., Cary, North Carolina, USA. ALL RIGHTS RESERVED.
3.4 Performing Data Analysis 3-55

ρ
Analysis Graphs: Relationship Plots
ρ ρ
ρ ρ ρ
Correlation matrix

• Evaluates linear relationships Heat map


• Displays degree of correlation • Shows nonlinear relationships
• Uses Pearson’s correlation • Uses two high-cardinality
coefficient measures
• Weak: |ρ| ≤ 0.3 • Uses two categories
• Moderate: 0.3 < |ρ| < 0.6 • Uses a category or a measure
• Strong: |ρ| > 0.6 Scatter plot

• Shows nonlinear relationships


• Low-cardinality measures

As part of your analysis, you might be interested in viewing relationships between measures. This
can be accomplished with relationship plots (like a correlation matrix, a scatter plot, or a heat map).
A correlation matrix can be used to evaluate the linear relationship between multiple measures. It
displays the degree of correlation as a matrix of rectangular cells. Each cell represents the
intersection of two measures, and the color of the cell indicates the degree of correlation between
those measures. The correlation values are calculated by using Pearson’s correlation coefficient.
They are identified as weak (if the absolute value of the correlation is 0.3 or lower), moderate (if the
absolute value of the correlation is greater than 0.3 and less than or equal to 0.6), or strong (if the
absolute value of the correlation is greater than 0.6). Positive correlation values indicate that as one
measure increases, so does the other, whereas negative correlation values indicate that as one
measure increases, the other decreases. Although two measures seem to have a weak relationship,
this does not mean that they have no relationship. Remember that the correlation measures the
linear relationship between measures. The actual relationship could be more complex (quadratic,
cubic).
These nonlinear relationships can best be displayed with a scatter plot or a heat map. Both can be
used to visualize trends between measures and to pinpoint possible outliers. The scatter plot works
best with low-cardinality measures and the heat map works best with high-cardinality measures.
Scatter plots can be used to evaluate the relationship between measures by displaying the values of
two measures using markers.
Heat maps can be used to evaluate the relationship between two high-cardinality measures,
between two categories, or between a category and a measure. A heat map displays the distribution
of values for two data items by using a table with colored cells.

Copyright © 2021, SAS Institute Inc., Cary, North Carolina, USA. ALL RIGHTS RESERVED.
3-56 Lesson 3 Analyzing Data Using SAS Visual Analytics

Question – Cardinality
Each report object has a threshold for how much data it can visually display. Many
report objects will not display high-cardinality data items with a large number of
unique values.

What are some examples of high-cardinality data items?

What are some examples of low-cardinality data items?

Answer – Cardinality
Each report object has a threshold for how much data it can visually display. Many
report objects will not display high-cardinality data items with a large number of
unique values.

What are some examples of high-cardinality data items?


Employee ID, Street Address, Customer Name, Birth Date

What are some examples of low-cardinality data items?


Country Name, Age Group, Job Title, Store Type

Copyright © 2021, SAS Institute Inc., Cary, North Carolina, USA. ALL RIGHTS RESERVED.
3.4 Performing Data Analysis 3-57

Fit Lines

Scatter plot P-Spline


• Penalized B-spline
Heat map • Closely fits data
Best Fit • Complex line with
many changes
Linear
• Straight line
• Correlation information

Quadratic Cubic
• Line with a single curve • Line with two curves
• Parabola • S shape

Fit lines can be added to scatter plots and heat maps to plot the relationship between variables.
When adding a fit line, you can select the type of relationship to plot: linear, quadratic, cubic, best fit,
or P-spline.
A linear relationship is plotted as a straight line that represents the relationship between the
measures. For this method, correlation information is automatically added to the plot.
A quadratic relationship is plotted as a line with a single curve that represents the relationship
between the measures. This method produces a line with the shape of a parabola.
A cubic relationship is plotted as a line with two curves that represents the relationship between the
measures. This method often produces a line with an S shape.
Best fit selects the most appropriate model (linear, quadratic, or cubic) for your data. This method
uses backward variable selection to select the highest-order model that is significant. Because of
this, best fit often selects more complex models (cubic and quadratic) over simpler models (linear).
A P-spline relationship creates a penalized B-spline. This is a smoothing spline that closely fits the
data. This method can display a complex line with many changes in its curvature.
Fit lines are great for quantifying the relationship between measures.

Copyright © 2021, SAS Institute Inc., Cary, North Carolina, USA. ALL RIGHTS RESERVED.
3-58 Lesson 3 Analyzing Data Using SAS Visual Analytics

Analysis Graphs: Time Plots

Line chart

• Shows trends over ordinal


Time series plot
variable (age group, time)
• Identifies patterns between
• Shows trends in
groups
measures over time
• Identifies seasonal
peaks and troughs

As part of your analysis, you might be interested in viewing relationships over time. This can be
accomplished with time plots like a time series plot or a line chart.
A time series plot can be used to show trends in measures over time by displaying data using a line
that connects data values. Time series plots are excellent for identifying seasonal peaks or troughs
in your data.
Line charts can also be used to show trends in measures over time but can be used for any ordinal
values (like age groups or loyalty levels). This can be helpful for identifying patterns among or
between ordinal groups.

Copyright © 2021, SAS Institute Inc., Cary, North Carolina, USA. ALL RIGHTS RESERVED.
3.4 Performing Data Analysis 3-59

Analytics: Forecasting
ARIMA

Damped-trend
exponential smoothing
Forecasting Linear exponential
Seasonal exponential smoothing
• Predict values using statistical trends
• Line = predicted values smoothing
• Colored band = confidence interval Simple exponential
• Six periods forecast (default) smoothing
Winters method
• 95% confidence interval (default)
(additive)
• Markers = historical values
• Forecast line = hindcast Winters method
(multiplicative)

After you identify historical trends in your data, you might want to try to predict future values by
forecasting.
The forecasting object uses the statistical trends in your data to predict future values. It displays a
line with predicted values and a colored band that represents the confidence interval. By default, the
next six periods are forecasted, and the 95% confidence interval is displayed. Historical values for
the forecasting model are displayed as markers only (without a line). Historical predicted values
(hindcast) are displayed as part of the forecast line. Visual Analytics automatically tests several
forecasting models against your data (ARIMA, damped-trend exponential smoothing, linear
exponential smoothing, seasonal exponential smoothing, simple exponential smoothing, Winters
method (additive), and Winters method (multiplicative)) and selects the best model.
Visual Statistics and Visual Data Mining and Machine Learning give you the added ability to create
your own models instead of relying on the model that is automatically selected for forecasting.
Visual Forecasting, on the other hand, gives you the power to produce large-scale time series
analyses and hierarchical forecasts.

Copyright © 2021, SAS Institute Inc., Cary, North Carolina, USA. ALL RIGHTS RESERVED.
3-60 Lesson 3 Analyzing Data Using SAS Visual Analytics

Adding Data Analysis


This demonstration illustrates how to add
data analysis to graphs in Visual Analytics.

Practice Scenario

Human Resources

Salary
Job title
differences
Years of
Orders Service

Profits

To complete your practice analysis, Management asked you to analyze the relationship between
salary, orders, profits, and years of service. Specifically, they are interested in determining whether
total orders might be a better criterion for promotion than profit generated.
In addition, they asked that you determine whether there are any job title differences between
employees based on years of service and the total profit generated. Do employees with specific job
titles tend to do well in terms of loyalty and performance? That will help Human Resources specify a
job title to recommend for promotions.

Copyright © 2021, SAS Institute Inc., Cary, North Carolina, USA. ALL RIGHTS RESERVED.
3.4 Performing Data Analysis 3-61

Practice: Adding Data Analysis


This practice reinforces the concepts
discussed previously.

Copyright © 2021, SAS Institute Inc., Cary, North Carolina, USA. ALL RIGHTS RESERVED.
3-62 Lesson 3 Analyzing Data Using SAS Visual Analytics

Copyright © 2021, SAS Institute Inc., Cary, North Carolina, USA. ALL RIGHTS RESERVED.
Lesson 4 Designing Reports with
SAS Visual Analytics
4.1 Creating a Simple Report ....................................................................................................... 4-4

4.2 Creating Interactive Reports ................................................................................................ 4-16

4.3 Working with Display Rules ................................................................................................. 4-36


4-2 Lesson 4 Designing Reports with SAS Visual Analytics

Copyright © 2021, SAS Institute Inc., Cary, North Carolina, USA. ALL RIGHTS RESERVED.
4.1 Creating a Simple Report 4-3

Introduction

Well organized

Create compelling,
interactive reports Easy to navigate

Attractive

Understanding your data isn’t enough to convey results to your audience in a way that is useful and
easy to understand. You need to create compelling, interactive reports so that viewers can find the
information that is important to them, when they need it. This means that you need to create reports
that are well organized, easy to navigate, and attractive.

Actions
Ranks

Simple report Links


Display
Pages rules
Prompts

In this lesson, you learn how to use Visual Analytics to design and create reports. You start by
creating a simple report. Then, you add pages, ranks, prompts, actions, and links to make the report
more interactive. Finally, you add display rules to highlight specific values in the report.

Copyright © 2021, SAS Institute Inc., Cary, North Carolina, USA. ALL RIGHTS RESERVED.
4-4 Lesson 4 Designing Reports with SAS Visual Analytics

4.1 Creating a Simple Report

Business Scenario

Marketing

Profits
Orders

Create report Add titles


30-44
45-59
and labels
60-74

Customer Order
Age Group Month

During the Analyze phase, you began analyzing groups for the next marketing campaign.
Specifically, you looked at profits by order type, location, loyalty member, and age group.
For your next assignment, the Marketing team has asked you to create a report that can be used to
identify customers in subsets of these groups (by order type, location, loyalty member, and age
group).
You will start by creating a simple report that analyzes profit and orders by age group and order
month. Because the report will be shared with others, you need to add more details to communicate
with your audience (for example, titles and labels).

Copyright © 2021, SAS Institute Inc., Cary, North Carolina, USA. ALL RIGHTS RESERVED.
4.1 Creating a Simple Report 4-5

Visual Analytics Methodology: Report


Easy to navigate
Report Attractive

Organized
Add
descriptions
Add Styles
instructions
Display
rules
Multiple Versatile
pages

Ranks Links
Viewer
Animation Actions
Prompts customization

In the Report phase of the Visual Analytics methodology, you need to create reports that are based
on your discoveries. Reports should be organized, easy to navigate, versatile, and attractive.
You can organize content by adding multiple pages to your reports. Your reports should focus on
telling a single data story. Pages can then be used to tell parts of that story (like chapters in a book).
You can make your reports easy to navigate by adding descriptions to define the purpose of your
report and instructions to describe the features of the report.
You can make your reports versatile (or interactive) by adding animations, ranks, prompts, actions,
and links. You can even set the viewer customization level to give viewers more control over the
appearance of the report.
Finally, you can add styles and display rules to make your reports more attractive.
After the reports are available, they can be shared with anyone, anywhere via the web or a mobile
device.

Copyright © 2021, SAS Institute Inc., Cary, North Carolina, USA. ALL RIGHTS RESERVED.
4-6 Lesson 4 Designing Reports with SAS Visual Analytics

Activity – Ugly Report


Visit www.sas.com/beautifulreports to view tips for creating effective reports.

Sign in to SAS Viya. Open Ugly Report (located in the Courses/YVA1 folder).

What are some issues with this report?

Answer – Ugly Report


What are some issues with this report?
• Pages do not have meaningful names.
• Inconsistent fonts, sizes, and colors.
• Difficult to determine the data story.
• Objects do not have meaningful names or titles.
• The graph used for the data isn’t appropriate.
• No guidance for viewers for pages or objects on a page.
• No instructions for prompts, actions, and links.
• Objects are not laid out in a clear manner.
• Too many objects on some pages.

Copyright © 2021, SAS Institute Inc., Cary, North Carolina, USA. ALL RIGHTS RESERVED.
4.1 Creating a Simple Report 4-7

Reporting Graphs
• Shows summary information
• One measure = size
Pie chart • One measure = color
• Difficult to compare relative
• Compares a few groups sizes
• Displays relative contribution • Number of letters
of each group to the whole • Size of letters
• Difficult to compare relative • Ascenders/descenders
sizes of slices
• Cannot show zero or Donut chart cat pig
negative values bees dog
• Easier to compare monkey snake
rabbit fish
relative sizes of slices
• Cannot show zero or Word cloud
negative values

During the Report phase, you want to use graphs that convey information to your audience in a
pleasing and clear fashion. The types of graphs you can use to accomplish this include pie charts,
donut charts, or word clouds.
A pie chart is best used to compare a few groups whose values vary greatly. These charts display
the relative contribution of each group to the whole using a circle that is divided into multiple slices.
Pie charts are popular, but be aware that it is very difficult to compare the relative sizes of slices in
the chart. Because of this, pie charts should be used sparingly and only in special circumstances.
For example, pie charts would work well to highlight large differences in groups or to show the
relative contributions of a few groups (fewer than five).
Donut charts are similar to pie charts but have a hole in the center. This hole makes it easier to
compare relative sizes because it forces the viewer to focus on reading the lengths of the arcs rather
than the proportions of the slices.
Neither of these charts can show a slice with a zero or negative response, so if your data has these
values, another chart type should be used.
Word clouds can be used to show summary information in an appealing fashion. A word cloud
analyzes each value of a category data item as a single text string. The value of one measure can
be used to size the word, and the value of another measure can be used to color the word.
Word clouds should be avoided if analytical accuracy is desired because it is difficult to compare the
relative sizes of different words.
Words that have more letters often seem larger than words that have fewer letters.
In addition, words that contain large letters (like o, m, and w) generally receive more attention than
words that contain smaller letters (like l, i, and f).
Lastly, words whose letters contain ascenders (the part of a lowercase letter that projects above the
body of the letter: b, d, or h) or descenders (the part of a lowercase letter that projects below the
body of the letter: g, p, or q) receive more attention than words that do not.
For these reasons, word clouds are mostly used for aesthetic purposes.

Copyright © 2021, SAS Institute Inc., Cary, North Carolina, USA. ALL RIGHTS RESERVED.
4-8 Lesson 4 Designing Reports with SAS Visual Analytics

Question – Choosing Graphs


Each graph below shows the number of orders for each product category. Does Golf
or Team Sports have more orders?

Answer – Choosing Graphs


Does Golf or Team Sports have more orders? Team Sports

Copyright © 2021, SAS Institute Inc., Cary, North Carolina, USA. ALL RIGHTS RESERVED.
4.1 Creating a Simple Report 4-9

Question – Chart Types


What type of chart would you use to show profit information by continent?

Continent Profit
a. bubble plot
Africa ($127.68)
b. pie chart
Asia $15,503.70
c. bar chart
Europe $5,659,450.59
d. treemap
North America $2,121,645.57
Oceania $462,934.63

Answer – Chart Types


What type of chart would you use to show profit information by continent?

a. bubble plot
b. pie chart
c. bar chart
d. treemap

Bubble plots require three measures.

Pie charts and treemaps cannot display negative values.

Copyright © 2021, SAS Institute Inc., Cary, North Carolina, USA. ALL RIGHTS RESERVED.
4-10 Lesson 4 Designing Reports with SAS Visual Analytics

Dual Axis Charts

Compares two series with


different ranges

Displays each series on a


separate axis

Makes it easy to see


relationships between the
series

When you want to compare two series with different ranges, dual axis charts can be very effective.
Dual axis charts display each series on a separate axis, which makes it easy to see relationships
between the series when the ranges are very different.

Dual axis bar-line


chart
Dual axis time
series plot

Dual axis bar chart


Dual axis line chart

Four types of dual axis charts can be created in Visual Analytics: a dual axis bar chart, a dual axis
bar-line chart, a dual axis line chart, and a dual axis time series plot.

Copyright © 2021, SAS Institute Inc., Cary, North Carolina, USA. ALL RIGHTS RESERVED.
4.1 Creating a Simple Report 4-11

Dual axis bar chart

• Use when current value does Dual axis bar-line


not depend on prior value chart

• Bar – use a measure whose


current value does not
depend on prior value
• Line – use a measure whose
current value does depend
on prior value

A dual axis bar chart displays two bar charts with a shared category axis and separate response
axes. Use a dual axis bar chart when the current value for both measures does not depend on the
prior value. For example, a dual axis bar chart could be used to show customer satisfaction and the
number of sales representatives’ customers by continent because the values for South America are
not impacted by the values for Africa.
A dual axis bar-line chart combines a bar chart and a line chart on a shared category axis. The bar
chart and the line chart have separate response axes. For the bar, use a measure whose current
value does not depend on the prior value. For the line, use a measure whose current value does
depend on the prior value. For example, a dual axis bar-line chart could be used to show
temperature and rainfall by month. For this chart, the line would display temperatures because the
temperature for February depends on the value from January. The bars would show rainfall because
the rainfall for February does not depend on the value from January.

Copyright © 2021, SAS Institute Inc., Cary, North Carolina, USA. ALL RIGHTS RESERVED.
4-12 Lesson 4 Designing Reports with SAS Visual Analytics

Dual axis time


series plot

• Use to spot seasonal movements


Dual axis line chart

• Use when current values


depend on prior values

A dual axis line chart displays data by using two lines that connect the data values for a shared
category axis on separate response axes. Use a dual axis line chart when the current value for both
measures depends on the prior value. For example, a dual axis line chart could be used to show
facility efficiency and number of employees by month because, for both measures, the values in
February are impacted by the values from January.
A dual axis time series plot displays two time series with a common time axis on separate response
axes. Dual axis time series plots are good for spotting seasonal movements (together or separate)
for two sets of time series data. For example, a dual axis time series plot could be used to show unit
actual and unit yield rates over time to show differences between production in the middle of the year
versus production during the holidays.

Copyright © 2021, SAS Institute Inc., Cary, North Carolina, USA. ALL RIGHTS RESERVED.
4.1 Creating a Simple Report 4-13

Creating a Simple Report

This demonstration illustrates how to


create a simple report in Visual Analytics.

Copyright © 2021, SAS Institute Inc., Cary, North Carolina, USA. ALL RIGHTS RESERVED.
4-14 Lesson 4 Designing Reports with SAS Visual Analytics

Practice Scenario

Human Resources

Number of Profits
Employees

Create report Add titles


and labels

Anniversary Location
Month

During the Analyze phase in the practice, you began analyzing groups of employees who are eligible
for promotion. Specifically, you looked at employees by location, job title, and employee group, and
you evaluated loyalty and performance as possible criteria for promotion.
For your next assignment, the Human Resources team asked for a report to identify which
employees can be promoted. They want a list of employees in subsets of these groups (by company,
job title, and group) to evaluate years of service and the total profit generated to determine
promotions. As a special “thank you,” they would like to promote these employees during their
anniversary months.
You will start by creating a simple report that analyzes the number of employees and the profit
generated by location and anniversary month. Because the report will be shared with others, you
need to add more details to improve communication with your audience (for example, titles and
labels).

Copyright © 2021, SAS Institute Inc., Cary, North Carolina, USA. ALL RIGHTS RESERVED.
4.1 Creating a Simple Report 4-15

Practice - Creating a Simple Report


This practice reinforces the concepts
discussed previously.

Copyright © 2021, SAS Institute Inc., Cary, North Carolina, USA. ALL RIGHTS RESERVED.
4-16 Lesson 4 Designing Reports with SAS Visual Analytics

4.2 Creating Interactive Reports

Business Scenario

Marketing
Customer orders Deliveries

Top 10 cities
by orders

Profit and orders


by loyalty

Viewer customization

After you shared your simple report with the Marketing team, they responded with high praise. The
report is satisfactory, but it needs a few simple modifications.
Specifically, the team would like the report to contain multiple pages, that is, one that shows details
about customer orders (to help choose the focus group) and one that shows details about deliveries
(for the Shipping team). You need to ensure that each object conveys the appropriate information for
that page.
On the Customer Order Analysis page, they want an analysis of profit and orders by loyalty.
On the Deliveries Analysis page, they request an analysis of the top 10 cities by orders over time, as
well as details about days to delivery, number of orders, and profit.
In addition, the team would like the ability to modify the data for each object so that they can play
around with different focus groups.
You will modify the simple report to set the viewer customization level, add multiple pages, more
report objects, and use ranks to create the requested objects.

Copyright © 2021, SAS Institute Inc., Cary, North Carolina, USA. ALL RIGHTS RESERVED.
4.2 Creating Interactive Reports 4-17

Viewer Customization

• Change object types

Simple edits
Data edits
• Sorting
• Simple options Comprehensive edits • Change data for objects
• Show data labels (default) • Data assignments
• Show legends • Filters
• Modify grouping style • Ranks

Beginning in SAS Visual Analytics 8.4, it’s possible to control the types of changes a report viewer
can make to a report using the Viewer Customization option at the report level. This option can be
set to simple edits, comprehensive edits, or data edits.
The simple edits level enables report viewers to make small changes to the report that do not
change the original intent of the report. For example, report viewers can change how the data is
sorted in an object and specify simple options for the object (like showing data labels and legends
and modifying the grouping style).
Comprehensive edits, the default level, enables report viewers to make changes to the report that
might alter the original intent of the report. For example, report viewers can change object types.
The data edits level enables report viewers to change the data for objects in the report. This option
setting gives report viewers almost full control of the report. For example, report viewers can change
data assignments, filters, and ranks for objects. If your data set contains personally identifiable
information, you need to be very careful about setting the Viewer Customization level to data edits
because it might be possible for viewers to use that information in the report.

Copyright © 2021, SAS Institute Inc., Cary, North Carolina, USA. ALL RIGHTS RESERVED.
4-18 Lesson 4 Designing Reports with SAS Visual Analytics

Creating Reports with Multiple Pages


Focus on a single idea Use hidden and pop-up
Report pages to provide details

Limit the number of


objects

Stand on its Limit the number of


own pages

Remember that the goal of reporting is to tell a single data story. Many times, that story can be told
in multiple parts. That’s where multiple pages are useful.
Each page in your report should focus on one aspect of the story and tell that piece with a limited
number of objects. Not only that, but you must ensure that each page can stand on its own. Viewers
should not be expected to remember details from one page to understand the concepts that are
communicated on another page. Basically, you want to ensure that each page communicates one
point that advances your data story.
In addition to adding multiple pages to your report, you can create pages that are hidden from report
viewers. These hidden pages can be useful to communicate details about the report to other
designers, or they can be linked to from an object on a regular page to enable viewers to see
additional details.
There is no limit to the number of pages that can be added to a report or the number of objects that
can be added to a page. However, it is a good idea to limit the number of pages to make your report
easier to access, easier to navigate, and easier to understand. If you need more than six or seven
visible pages to tell your data story, you should consider creating multiple reports and use links
between them to provide additional information.

Copyright © 2021, SAS Institute Inc., Cary, North Carolina, USA. ALL RIGHTS RESERVED.
4.2 Creating Interactive Reports 4-19

Working with Pages and Ranks

This demonstration illustrates how to


create new pages, how to move graphs
between pages, and how to apply ranks
to graphs in Visual Analytics.

Copyright © 2021, SAS Institute Inc., Cary, North Carolina, USA. ALL RIGHTS RESERVED.
4-20 Lesson 4 Designing Reports with SAS Visual Analytics

Practice Scenario

Human Resources
Employees Profits

Profit by
product group

Viewer customization

After you shared your simple report with the Human Resources team, they suggested a few simple
modifications.
Specifically, they would like the report to contain multiple pages—specifically, one page that
analyzes employees and one page that analyzes profits.
On the Profit Analysis page, they want an analysis of profit by product group.
In addition, you need to set the Viewer Customization level so that users cannot change the data or
the type of chart used in the report.
You will modify the simple report to add multiple pages and the additional requested, report object.

Copyright © 2021, SAS Institute Inc., Cary, North Carolina, USA. ALL RIGHTS RESERVED.
4.2 Creating Interactive Reports 4-21

Practice - Working with Pages


This practice reinforces the concepts
discussed previously.

Copyright © 2021, SAS Institute Inc., Cary, North Carolina, USA. ALL RIGHTS RESERVED.
4-22 Lesson 4 Designing Reports with SAS Visual Analytics

Business Scenario

Marketing
Customer orders Deliveries

Link
Page prompt
action

Filter Filter
action action

After you shared your updated report with the Marketing team, they asked for additional
modifications.
For the Customer Order Analysis page, they want to view group details for a specific order type
(Retail, Internet, or Catalog). They also want to view trends in profits and orders by age group for
loyalty and non-loyalty members.
For the Delivery Analysis page, they requested details about profits, orders, and delivery times for a
selected city.
You need to make the report more interactive by adding prompts and actions.

Copyright © 2021, SAS Institute Inc., Cary, North Carolina, USA. ALL RIGHTS RESERVED.
4.2 Creating Interactive Reports 4-23

Filtering Data
Page
Prompts Report
Viewer
Report Links
Page
Report
Actions

Linked External URL


selection
Filter

Many types of filters can be created to subset data in Visual Analytics. In general, these filters are
split between those that can be modified by only the report designer and those that can also be
modified by the report viewer. In this lesson, we focus on filters that can be modified by the report
viewer.
These filters can be classified into three types: prompts, actions, and links.
Prompts enable you to subset all data in the report or on a page. If you need to subset specific
objects, you can use actions.
You can add two types of prompts to a report: report prompts and page prompts.
Report prompts filter all objects in the report, and page prompts filter all objects on a single page.
Both types of prompts automatically filter all objects. If you prefer to focus the filter on specific
objects, you can use actions.
The filter action subsets the data in specific objects on the page, based on selections in a source
object. The linked selection action highlights the data in specific objects on the page, based on
selections in a source object.
Links can be used to subset another report, another page in the same report, or an external URL
based on selections in a source object. Links automatically filter the target object (report or page) if
both the source and the target use the same data source.
Filters enable you to create general reports that can be widely used for diverse areas of interest by
empowering viewers to find answers to their unique questions.

Copyright © 2021, SAS Institute Inc., Cary, North Carolina, USA. ALL RIGHTS RESERVED.
4-24 Lesson 4 Designing Reports with SAS Visual Analytics

Prompts

Filter or narrow the scope of


data

Focus on a specific area of


interest
Auto control
Select appropriate control for
your data • Appropriate control chosen
based on type and cardinality
of data item

Both report and page prompts can be created by using controls. A control is a report object that can
be used to filter or narrow the scope of the data that is used in the report. Controls provide a way for
report viewers to focus on a specific area of interest.
To use controls effectively, you need to select the appropriate control for your data.
One option is to use auto controls. Auto controls can be created by dragging data items to the report
or page prompt area. Visual Analytics chooses the appropriate control based on the type (category,
datetime, or measure) and the cardinality of the data item.

Copyright © 2021, SAS Institute Inc., Cary, North Carolina, USA. ALL RIGHTS RESERVED.
4.2 Creating Interactive Reports 4-25

Consider the type and


cardinality of the data item

Slider control

• Date and measure data items


• Select a single value or range
List control
of values
• Category data items
• Select multiple values

Alternatively, you can select your own control object. When selecting control objects, you need to
consider the type and cardinality of the data item.
For date and measure data items, a slider control should be used. This control enables a viewer to
move a selector horizontally or vertically to select a single value or a range of values.
For category data items, the control that you use depends on whether you want the viewer to select
multiple values or a single value.
To select multiple values, a list control should be used. This control enables a viewer to select one or
more category values from a list.

Copyright © 2021, SAS Institute Inc., Cary, North Carolina, USA. ALL RIGHTS RESERVED.
4-26 Lesson 4 Designing Reports with SAS Visual Analytics

Consider the type and


cardinality of the data item

Drop-down list
Button bar
• Category with moderate number
of distinct values
• Category with few distinct values

a
Text input

• Category with many distinct values

To select a single value, you also need to consider the cardinality. Remember that the cardinality
measures the number of distinct values for a category data item.
Categories with few distinct values (that is, fewer than 5) can be used with a button bar. A button bar
displays buttons in a vertical or horizontal layout.
Categories with a moderate number of distinct values (between 5 and 40) can be used with a drop-
down list.
Categories with many distinct values (that is, more than 40) can be used with a text input control. A
text input control enables a viewer to enter text in a field. As text is entered, the list of available
values is updated.

Copyright © 2021, SAS Institute Inc., Cary, North Carolina, USA. ALL RIGHTS RESERVED.
4.2 Creating Interactive Reports 4-27

Question – Control Objects


Given the distinct values, which control object would you use to filter for each
category displayed below?

Product Category - 12

Product Group - 57

Product Line - 4

Product Name - 3.2K

Answer – Control Objects


Given the distinct values, which control object would you use to filter for each
category displayed below?

Product Category - 12 Drop-down list control

Product Group - 57
Text input control Product Line - 4 Button bar control

Product Name - 3.2K


Text input control

Copyright © 2021, SAS Institute Inc., Cary, North Carolina, USA. ALL RIGHTS RESERVED.
4-28 Lesson 4 Designing Reports with SAS Visual Analytics

Actions

Linked selection Filter

1 1

One way to create interactive reports is with actions. Actions are used to direct a report viewer’s
attention to specific results in a report. Two types of actions are available: linked selections and
filters.
A linked selection action enables you to show the same data highlighted simultaneously in two or
more objects. The data for the linked selection has the same appearance in each object. This makes
it easy for the report viewer to identify and compare the values.
A filter action, on the other hand, enables you to restrict the data displayed in other objects. Filters
make it easy for the report viewer to focus on specific areas of interest.

Copyright © 2021, SAS Institute Inc., Cary, North Carolina, USA. ALL RIGHTS RESERVED.
4.2 Creating Interactive Reports 4-29

In this example, the list control filters the geo map, so only countries in Europe are displayed. The
geo map then filters both the bar chart and the list table, so only details about products in Italy are
shown. A linked selection is also established between the bar chart and the list table, so when a
specific product line is selected in one object, it is highlighted in the other.

Working with
Prompts and Actions
This demonstration illustrates how
to add page prompts and actions
to create interactive reports in
Visual Analytics.

Copyright © 2021, SAS Institute Inc., Cary, North Carolina, USA. ALL RIGHTS RESERVED.
4-30 Lesson 4 Designing Reports with SAS Visual Analytics

Practice Scenario

Human Resources
Report prompt

Employees Profits

Page prompt

Link
action Ranks

After you shared your updated report with the Human Resources team, they asked for additional
changes.
For the report, they requested the ability to filter by employee type (active versus retired).
For the Employee Analysis page, they want to see profit information by job title and anniversary
month for a selected country.
For the Profit Analysis page, they would like to be able to filter by company. In addition, they require
a list of the top five employees for a selected product group.
You need to make the report more interactive by adding prompts, actions, and ranks.

Copyright © 2021, SAS Institute Inc., Cary, North Carolina, USA. ALL RIGHTS RESERVED.
4.2 Creating Interactive Reports 4-31

Practice - Working with Prompts


and Actions
This practice reinforces the concepts
discussed previously.

Business Scenario

Marketing
Customer details

30-44
45-59
60-74

Customer
Order Type Age Group

Loyalty Member

After you shared your updated report with the Marketing team, they asked for additional
modifications.
Specifically, they want to subset the population by order type, loyalty member, and age group. They
also requested the ability to view a new page that contains a list of target customers, details about
each customer, and details those customers’ individual orders.
You will make these changes by adding a hidden page and a link to the report.

Copyright © 2021, SAS Institute Inc., Cary, North Carolina, USA. ALL RIGHTS RESERVED.
4-32 Lesson 4 Designing Reports with SAS Visual Analytics

Links

Report
Page External URL

Report

Another way to create interactive reports is with links. Links have elements of both a filter and an
action. Three types of links are available: page links, report links, and URL links.
Page links enable you to access another page in the same report, and report links enable you to
access another report. If the source and the target of the link use the same data source, an
automatic filter is passed through the link.
Alternatively, you can specify a URL link, which enables you to access and view an external web
page. For URL links, you have the added ability to specify parameters that pass data item values to
the URL.

Copyright © 2021, SAS Institute Inc., Cary, North Carolina, USA. ALL RIGHTS RESERVED.
4.2 Creating Interactive Reports 4-33

Working with Hidden Pages


and Page Links
This demonstration illustrates how to
create hidden pages and how to add
page links to create interactive reports
in Visual Analytics.

Copyright © 2021, SAS Institute Inc., Cary, North Carolina, USA. ALL RIGHTS RESERVED.
4-34 Lesson 4 Designing Reports with SAS Visual Analytics

Practice Scenario

Human Resources
Employee details

Employee
Status Page prompt
Job Title

Location

After you shared your updated report with the Human Resources team, they requested some
changes.
Specifically, they want to subset the population by employee status, location, and job title. They also
want to view a new page that contains a list of employees that are eligible for promotion, details
about each employee, and information about the orders that they managed. In addition, they would
like to filter this list to view employees with a minimum number of service years.
You will make these changes by adding a hidden page, a prompt, and a link to the report.

Copyright © 2021, SAS Institute Inc., Cary, North Carolina, USA. ALL RIGHTS RESERVED.
4.2 Creating Interactive Reports 4-35

Practice - Working with Hidden Pages


and Links
This practice reinforces the concepts
discussed previously.

Copyright © 2021, SAS Institute Inc., Cary, North Carolina, USA. ALL RIGHTS RESERVED.
4-36 Lesson 4 Designing Reports with SAS Visual Analytics

4.3 Working with Display Rules

Business Scenario

Marketing Customer details


Customer orders

Generate a
loss

More than
100,000 orders

After you shared the updated report with the Marketing team, they asked for some final changes.
They would like you to update styles and colors to make the report more appealing.
For the Customer Orders Analysis page, they want to see a visual indication for countries that
generate more than 100,000 orders.
In addition, when viewing the list of target customers, they requested a visual indicator for customers
who generate a loss.
You will make these changes to the report by modifying styles and adding graph-level display rules.

Copyright © 2021, SAS Institute Inc., Cary, North Carolina, USA. ALL RIGHTS RESERVED.
4.3 Working with Display Rules 4-37

Graph-Level Display Rules


Color-mapped
Use colors to identify areas of values
interest

Can be added to an object


(graph or table) Expression • Based on a category
• Associates colors with
specific values
Can be added to the report

• Based on a measure
• Applied to background
• Applied to graph

Display rules enable you to use colors to identify specific areas of interest. Display rules can be
added for a specific object (graph or table) or to the entire report.
For most graph objects (bar chart, treemap, others), two types of display rules can be added:
expression display rules or color-mapped values display rules.
Expression display rules are based on the value of a measure data item. For a graph, the display
rule can be applied to the background of the graph or to the graph itself. Expression display rules are
great for showing values that outperform or underperform a specific target or for easily identifying the
range in which the actual values occur.
Color-mapped values display rules are based on the value of a category data item. These display
rules are excellent for associating colors with specific values. (Coal is gray.) They can be used to
add consistency in your reports.

Copyright © 2021, SAS Institute Inc., Cary, North Carolina, USA. ALL RIGHTS RESERVED.
4-38 Lesson 4 Designing Reports with SAS Visual Analytics

Table-Level Display Rules


List table Color-mapped
values

Gauge
Expression
• Based on a category
• Applied to any column
• Applied to entire row
• Based on intervals of a
• Based on a measure measure
• Applied to measure • Applied to any column
• Applied to any column • Displayed to left or
• Applied to entire row right of measure
• Replaces the measure

Display rules can use colors in table objects (list tables or crosstabs) to identify specific areas of
interest.
For list tables, three types of display rules are available: expression, color-mapped values, and
gauge.
Expression display rules are based on the value of a measure data item. For a list table, the display
rule can be applied to the measure that is used in the expression, to another column in the table, or
to the entire row. Expression display rules are excellent for showing values that outperform or
underperform a specific target or for easily identifying the range in which the actual values fall.
Color-mapped values display rules are based on the value of a category data item. For a list table,
the display rule can be applied to any column in the table or to the entire row. Color-mapped values
display rules are great for associating colors with specific values. (Coal is gray.) They can be used to
add consistency in your reports.
Gauge display rules are based on intervals for a measure data item. For a list table, the display rule
can be added to any column in the table. It can be displayed to the left or to the right of the value, or
it can replace the value. Gauge display rules are ideal for showing the overall performance of a
measure with a single glance, without having to focus on details.

Copyright © 2021, SAS Institute Inc., Cary, North Carolina, USA. ALL RIGHTS RESERVED.
4.3 Working with Display Rules 4-39

Crosstab Expression

• Based on a measure
• Applied to measure
• Applied to any column
• Applied to entire row

Crosstabs, on the other hand, accept only expression display rules.

Report-Level Display Rules

Report
Color-mapped
values

• Applied at report level


• Any portion of object (bar, cell,
bubble) uses the colors
• Helps you identify and compare
the same value

Color-mapped values display rules can also be applied at the report level. In this case, any portion of
an object (bar, cell, bubble) that represents the value uses the colors that are specified in the display
rule. This helps you easily identify and compare the same value across multiple report objects.
Report-level display rules apply to all objects in the report and are a perfect way to add consistency
across your reports.

Copyright © 2021, SAS Institute Inc., Cary, North Carolina, USA. ALL RIGHTS RESERVED.
4-40 Lesson 4 Designing Reports with SAS Visual Analytics

Working with
Graph-Level Display Rules
This demonstration illustrates how to
add graph-level display rules in Visual
Analytics.

Copyright © 2021, SAS Institute Inc., Cary, North Carolina, USA. ALL RIGHTS RESERVED.
4.3 Working with Display Rules 4-41

Practice Scenario

Human Resources

Employee Report
Profits

Level of
Profit

Job Title

After you shared the updated report with the Human Resources team, they asked for some final
changes.
For the report, they want to see a visual indication for each job title.
In addition, for the Profits Analysis page, they requested colors so that they can easily determine the
level of profits that are generated for each group (low, medium, or high).
You will make these changes to the report by adding a report-level display rule and three graph-level
display rules.

Copyright © 2021, SAS Institute Inc., Cary, North Carolina, USA. ALL RIGHTS RESERVED.
4-42 Lesson 4 Designing Reports with SAS Visual Analytics

Practice - Working with Report-Level


and Graph-Level Display Rules
This practice reinforces the concepts
discussed previously.

Copyright © 2021, SAS Institute Inc., Cary, North Carolina, USA. ALL RIGHTS RESERVED.

You might also like