Chapter 4: Creating a Simple Report

4.1 Introduction

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 and instructions to describe the features of your report. You can make your reports versatile (or interactive) by adding animations, ranks, prompts, actions, and links. 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.

Activity 4.1

Sign in to SAS Viya.

Open Ugly Report (located in the Courses/YVA185/Basics folder). What are your first impressions of this report?

Do you think it can be improved? If so, how?

Here are some tips to make a good report:

● Understand the audience.

● Make accessible to all.

● Tell a single data story.

● Use visually appealing, easy-to-understand objects.

● Use the simplest graph.

● Use consistent fonts.

● Limit the number of objects.

● Limit the number of pages.

For more information about how to create effective reports, see www.sas.com/beautifulreports.

4.2 Graphs

During the Report phase, you want to use graphs that convey information to your audience in a pleasing and clear fashion. One way to accomplish this could be with pie charts, donut charts, or word clouds.

Pie Charts

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. Donut charts are similar to pie charts but have a hole in the center. This hole makes it easier to compare relative slices 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.

Figure 4.1: Graphs

Word Clouds

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) will 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: like b, d, or h) or descenders (the part of a lowercase letter that projects below the body of the letter: like g, p, or q) receive more attention than words that do not. For these reasons, word clouds are mostly used for aesthetic purposes.

Dual Axis Charts

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. 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.

Figure 4.2: Dual Axis Graphs

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, in the top left chart in Figure 4.2, customer satisfaction and the numbers of sales representatives’ customers 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, in the top right chart in Figure 4.2, the value of temperature for February depends on the value from January. However, the value of rainfall for February does not depend on the value from January.

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, in the bottom left chart in Figure 4.2, the values of facility efficiency and facility employees in February are impacted by the values from January. This chart is an excellent example of why separate axes can show relationships that a single axis does not. If both series were placed on the same axis, the line for facility efficiency would appear as a straight line near 1. However, because these series are plotted on separate axes, you can see the inverse relationship between the series. When the number of employees increases, efficiency declines and when the number of employees decreases, efficiency improves.

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 for two sets of time series data. For example, in the bottom right chart in Figure 4.2, you can see that the values for unit actual and unit yield rate tend to stay flat in the middle of the year and show a pronounced increase toward the end of the year. This is likely the result of increased purchases during the holidays.

Demo 4.1: Creating a Simple Report

This demonstration illustrates how to create a simple report in Visual Analytics.

1. From the browser window, sign in to SAS Viya.

2. In the upper left corner, click (Show list of applications) and select Explore and Visualize. SAS Visual Analytics appears.

3. Click All Reports.

a. Navigate to the Courses/YVA185/Basics/Demos (Marketing) folder.

a. Double-click the VA1- Demo4.1 report to open it.

4. Change the settings to add custom titles for all graph objects.

a. In the upper right corner, select <user name> Settings.

b. On the left side of the window, select General under SAS Visual Analytics.

c. Scroll down to Default titles for new objects.

d. For Graphs, change No title to Custom title.

e. Click Close.

5. Hide data items.

a. In the left pane, click Data.

b. In the upper right corner of the Data pane, click (Actions) and select Show or hide data items.

c. Click (Remove all) to move all data items to the Available items list.

d. Double-click the following data items to add them to the Selected items list:

Customer Age Group

Frequency

Number of Orders

Order

Month

Profit

The Selected items list should resemble the following:

f. Click OK.

The Data pane should resemble the following:

6. Create a pie chart.

a. In the left pane, click Objects.

b. Drag the Pie chart object, from the Graphs group, to the top of the canvas.

c. In the right pane, click Roles.

d. For the Category role, select Add Customer Age Group.

e. For the Measure role, select Frequency Number of Orders.

The pie chart should resemble the following:

By default, the slices in a pie chart are sorted by the measure in descending order.

f. Below the pie chart, right-click Customer Age Group and select Sort Customer Age Group: Ascending.

The updated pie chart should resemble the following:

g. Double-click the title, Untitled.

A font formatting tool appears that you can use to format the title.

h. Enter Number of Orders by Customer Age Group as the title.

i. In the right pane, click Options.

j. In the Object group, for the Name field, enter Orders by Age Group.

k. In the Pie group, clear “Other” slice.

l. Clear Pie label.

The updated pie chart should resemble the following:

7. Create a bar chart.

a. In the left pane, click the Objects tab.

b Drag the Bar chart object, from the Graphs group, to the drop zone on the right side of the pie chart.

c. In the right pane, click Roles.

d. For the Category role, select Add Order Month.

e. For the Measure role, select Frequency Profit.

For the Measure role, select Add Number of Orders and click OK. The bar chart should resemble the following:

Because Profit and Number of Orders have different ranges, they are displayed in different bar charts. You can change to a dual axis bar chart to display both measures together.

f Right-click the bar chart and select Change Bar chart to Dual axis bar chart. Note: This option is not available if the object is maximized.

g. In the dual axis bar chart, on the horizontal axis, right-click Order Month and select Sort Order Month: Ascending.

h. In the right pane, click Options.

i. In the Object group, for the Name field, enter Profit and Orders.

j. For the Title field, enter Profit and Number of Orders by Month.

k. In the X Axis Options group, clear Axis label.

The updated dual axis bar chart should resemble the following:

The report should resemble the following:

8. Save the report.

Practice 4.1

1. Creating a Simple Report

a. Open the browser and sign in to SAS Viya.

b. Open the VA1-Practice4.1 report from the Courses/YVA185/Basics/Practices (HR) folder.

c. Create a geo coordinate map to the left of the bar chart.

d. Modify the following options for the geo map:

Object: Name

Average Profit by Country

Object: Custom Title

Average Profit by Country

Object

Geo Coordinate

Legend: Visibility

Off

e. Assign the following data items to the specified roles:

Geography

Employee Country

Color

Average Profit

Data tip values

Number of Employees

The geo map should resemble the following:

f. Maximize the geo map and answer the following questions: Which country has the highest average profit? The lowest?

Answer:

Which country has the highest number of employees? The lowest?

Answer:

g. Create a dual axis bar-line chart at the bottom of the canvas. Assign the following data items to the specified roles:

Category

Anniversary Month

Measure (bar)

Number of Employees

Measure (line)

Average Profit

h. Modify the following options for the dual axis bar-line chart:

Object: Name

Employees and Profit by Anniversary Month

Object: Custom Title

Employees and Profit by Anniversary Month

Line: Markers

<selected>

i. Sort the bars by Anniversary Month in ascending order. The dual axis bar-line chart should resemble the following:

j. Maximize the dual axis bar-line chart and answer the following questions: In which month were the most employees hired?

Answer:

Which anniversary month contains employees that generate the highest average profit?

Answer:

The report should resemble the following:

k. Save the report.

4.3 Creating Interactive Reports

Beginning in SAS Visual Analytics 8.4, the types of changes a report viewer can make to a report can be set using the Viewer Customization option at the report level.

The available levels of permissions are as follows:

Simple edits

Enables report viewers to make changes that do not change the original intent for the report content. For example, report viewers can change how the data is sorted or change legends and value labels.

Comprehensive edits (default)

Enables report viewers to make changes that might alter the original intent of the report. For example, report viewers can change object types.

Data edits

Enables report viewers to change the data for objects in the report. For example, report viewers can change data assignments, filters, and ranks.

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.

Multiple Pages

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, 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 will advance your data story.

Figure 4.3: Creating Reports with Multiple Pages

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.

Each page in your report can use one or more data sources and can contain one or more report objects. There is no limit to the number of pages that can be added to a report. However, it is a good idea to limit the number of pages in a report 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 reports to provide additional information.

Note: Links are discussed in more detail in a later section.

Demo 4.2: 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.

1. From the browser window, sign in to SAS Viya.

2. In the upper left corner, click (Show list of applications) and select Explore and Visualize . SAS Visual Analytics appears.

3. Click All Reports.

a. Navigate to the Courses/YVA185/Basics/Demos (Marketing) folder.

b. Double-click the VA1-Demo4.2a report to open it.

4. Change the viewer customization level.

a. In the right pane, click Options.

b. Use the drop-down list on the top of the Options pane to select the report.

c. In the Viewer Customization group, select Data edits.

This option enables viewers to make changes to the data used in objects, as well as the filters and ranks applied to objects.

5. Create a new page.

a. In the upper left corner of the report, next to Page 1, click (New page).

b. Double-click the Page 2 heading to make it editable.

c. Enter Delivery Analysis and press Enter.

d. Click Page 1 to make it active.

e. Right-click Page 1 and select Rename page.

f. Enter Customer Order Analysis and press Enter.

6. Move the Profit and Orders by Month bar chart to the new page.

Right-click the Profit and Orders by Month bar chart and select Move to Delivery Analysis.

Note: You can also drag an object and drop it onto the new page tab. Alternatively, objects can be moved from one page to another using the Outline pane.

7. Click the Customer Order Analysis tab to make it active.

8. Rearrange the graphs on the Customer Order Analysis page so that it resembles the following:

9. Create a bubble plot.

a. Click the Delivery Analysis tab to make it active.

b. In the left pane, click Objects.

c. Drag the Bubble plot object, from the Graphs group, to the left side of the canvas.

d. In the right pane, click Roles.

e. For the Group role, select Add City Name.

f For the X axis role, select Add Days to Delivery.

g For the Y axis role, select Add Number of Orders.

h. For the Size role, select Frequency Profit.

A warning appears in the lower right corner of the bubble plot.

There are too many distinct values of City Name to display as bubbles in the plot. Later, you add a rank to reduce the number of bubbles.

i. For the Animation role, select Add Order Month.

j. In the right pane, click Options.

k. In the Object group, for the Name field, enter Order Information by Month.

l. For the Title field, enter Top 10 Cities by Number of Orders.

m. In the right pane, click Ranks.

n. In the Ranks pane, select New rank City Name.

o. Verify that Top count is specified.

p. For the Count field, verify that 10 is specified.

q. For the By field, select Number of Orders.

r. Select the box for Ties.

The bubble plot should resemble the following:

s. In the lower left corner of the bubble plot, click to play the animation.

10. Save the report.

11. View the report.

a. In the upper left corner, click (View report) to view the report.

b. Right-click the dual axis bar chart and select Replace data Number of Orders.

c. Select Days to Delivery.

d. Right-click the dual axis bar chart and select Sort Order Month: Ascending.

The dual axis bar chart should resemble the following:

Because the Viewer Customization level for the report was set to Data edits, users can change the data used in each report object while viewing the report.

12. Save a copy of the report.

a. In the upper right corner, click (Menu) and select Save a copy.

When anyone saves a copy of a report while viewing it, that user cannot choose a name or a location for the saved report.

The following message appears:

The report is saved to My Folder with a name that includes the date and time at which the copy was created. This copy can then be shared with other users.

13. In the upper right corner, click (Menu) and select Close to close the rep

Practice 4.2

1. Working with Pages

a. Open the browser and sign in to SAS Viya.

b. Open the VA1-Practice4.2a report from the Courses/YVA185/Basics/Practices (HR) folder.

c. Set the Viewer Customization level so that users cannot change the data or the type of chart used in the report.

d. Add a new page to the report.

- Change the name of the new page to Profit Analysis.

- Change the name of Page 1 to Employee Analysis.

e. Create a bar chart on the Profit Analysis page by assigning the following data items to the specified roles:

Category

Group

Measure

Total Profit

f. Specify Total Profit by Group as the name and title of the bar chart.

g. Sort the bars by Group in ascending order.

The Profit Analysis page should resemble the following:

h. Maximize the bar chart and answer the following questions: Which group produces the highest total profit?

Answer:

Which group produces the lowest total profit?

Answer:

i. Save the report.

j. View the report.

k. On the Profit Analysis page, sort the bars by Total Profit in descending order and show data labels.

l. Close the report.

Filtering

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. Actions, however, can be used to subset specific objects. You can add two types of prompts to a report: report prompts or page prompts. Report prompts filter all objects in the report, and page prompts filter all objects on a single page. Selections that are made in report prompts also filter the values that are available in page prompts. In this example, the year 2014 is selected in the drop-down list in the report prompt area. All objects in the report are filtered to show data for 2014, including the slider control in the page prompt area. In addition, Europe is selected on the button bar in the report prompt area. All objects in the report, including the text input control in the page prompt area, are filtered to show data for Europe. Both types of prompts automatically filter all objects.

Figure 4.3: Filtering Data

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. 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. Link actions will automatically filter the target object 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.

The following types of filters can be modified by report viewers:

Table 4.1: Filters

Filter Type

Description

Report prompt

Automatically subsets the data for all objects in the report if the report object uses the same data source as the prompt. *

Page prompt

Automatically subsets the data for all objects on the page if the report object uses the same data source as the prompt. *

Filter action

Subsets the data in the target object based on selections in a source object.

Linked selection action

Highlights the data in the target object based on selections in a source object.

Links

Subsets the report, page, or an external URL based on the selections in a source object. Links pass a value to filter the target object (report or page) when the source and target are based on the same data source.

* For all prompts and actions, if the report objects use different data sources, automatic mappings are applied. You can modify the data source mappings by right-clicking the control and selecting Edit data source mappings. For more information about mapping data sources, see “Map Data Sources for Actions and Links” in the SAS Visual Analytics: Working with Report Data documentation.

For more information about prompts, see “Working with Controls” in the SAS Visual Analytics: Working with Report Content documentation.

For more information about actions and links, see “Working with Report Actions and Links” in the SAS Visual Analytics: Working with Report Data documentation.

Controls and Prompts

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 and the cardinality of the data item. For more information about the type of control that is selected using auto controls with specific data assignments, see the Resource section of this lesson. Alternatively, you can select your own control object. When selecting control objects, you need to consider the type and cardinality of the data item.

Figure 4.4: Report Controls

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 will depend 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 object enables a viewer to select one or more category values from a list. 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 (less 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 (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.

A control is a report object that filters or narrows the scope of the data viewed in the report. Controls provide a way for report viewers to focus on specific areas of interest.

Note: When multiple control object are used to filter values, the AND operator is used for the filter.

List

A list control enables a viewer to select one or more category values from a list.

Note: List controls can be used as a report prompt or page prompt only if it is located inside a prompt container or if the report or page control placement option is set to left or right.

Slider

A slider control enables a viewer to move a selector horizontally or vertically to select a single value or a range of values. A slider control accepts only date time or measure data items.

Note: When a parameter is used with a slider control, the control is converted to a single-point slider.

A control is a report object that filters or narrows the scope of the data viewed in the report. Controls provide a way for report viewers to focus on specific areas of interest.

Note: When multiple control objects are used to filter values, the AND operator is used for the filter.

Figure 4.5: Report and Page Prompts

In the display capture above, page controls are placed on the left side of the page. Beginning in SAS Visual Analytics 8.4, report designers can change the position of report and page controls. The Placement option enables you to place the controls at the top, bottom, left, or right. If you want reports that you create to have the same placement for controls, you can use the Default report controls placement and Default page control placement settings for Visual Analytics. If the report or page controls are placed on the left or right, you can add a list control to the prompt area (as seen above).

Note: Report and page prompt areas are not displayed by default when editing a report.

Note: Auto controls can be created by dragging data items to the report or page prompt area.

Data Items

Control Type

Category with 1–4 distinct values

Button bar

Category with 5–40 distinct values

Drop-down list

Category with more than 40 distinct values

Text input

Datetime

Slider

Measure

Slider

Actions

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. 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.

Figure 4.5: Actions

Actions are used to direct a report viewer’s attention to specific results in a report.

The following actions are available:

Table 4.2: Actions

Action

Description

Linked selection

A linked selection action enables you to show the same data highlighted simultaneously in two or more tables, graphs, or controls on the same page. The data for the linked selection action has the same appearance in each object, which makes the data easily apparent to report viewers.

Filter

A filter action enables you to restrict the data displayed in other objects on the page. A viewer can select a subset of data in the source object and see the restricted data for any target objects.

Figure 4.6: Adding Actions to a Page

Demo 4.3: Working with Prompts and Actions

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

1. From the browser window, sign in to SAS Viya.

2. In the upper left corner, click (Show list of applications) and select Explore and Visualize . SAS Visual Analytics appears.

3. Click All Reports.

a. Navigate to the Courses/YVA185/Basics/Demos (Marketing) folder.

b. Double-click the VA1- Demo4.2b report to open it.

4. Add a page prompt to Customer Order Analysis.

a. If necessary, click the Customer Order Analysis page to make it active.

b. On the Customer Order Analysis tab, click (Options) and select Expand page controls.

The page prompt area is shown on the page:

Note: You can also display report controls and all page controls for the report. To display the report controls, click (Menu) and select Expand report controls. To display both report and page controls, click (Menu) and select Expand report controls and all page controls.

Note: In the general settings for Visual Analytics, you can specify whether to expand report and page controls by default for new pages.

c. In the left pane, click Data.

d. Drag Order Type, from the Category group, to the Drop a data item or control to create a page prompt area.

An auto control determines the best control object to use for the selected data.

e. In the right pane, click Options.

f. In the Object group, for the Name field, enter Order Type Selector.

g. For the Title field, select Custom title.

h. For the Title field, enter Select an order type:. The auto control should resemble the following:

i. For the control, click Catalog Sale to filter the objects on the page. The Customer Order Analysis section should resemble the following:

j. For the control, click Catalog Sale to deselect it.

5. Add actions between objects on the Delivery Analysis page.

a. Click the Delivery Analysis page to make it active.

b. In the canvas, click the drop-down list control to select it.

c. In the right pane, click Actions.

d. In the Object Links group, select Profit and Orders (the dual axis bar chart).

e. Verify that (Filter) is selected.

f. Select Order Information by Month (the bubble plot).

g. Click (Filter) and select Linked selection.

The Actions pane should resemble the following:

h. In the Actions pane, click View Diagram. The Actions Diagram window appears.

Note: The Actions Diagram window can also be used to create actions between objects. Simply click and drag between objects to create the action.

6. Click Close.

7. Save the report.

8. View the report.

a. In the upper left corner, click (View report) to view the report.

b. At the top of the report, click the Customer Order Analysis tab to make the page active.

c. In the button bar, click Internet Sale.

The Customer Order Analysis page updates to show information about internet products ordered.

d. In the upper right corner of the pie chart, click (Maximize).

A lower percentage of all internet orders is placed by customers in the older age groups (60-75 years and 75 and above) compared to younger age groups. This appears to be a generational difference. How do we plan for this difference in ordering patterns among different age groups? Do we expect this difference to continue over time, or do we expect the difference to eventually get smaller?

e In the upper right corner of the pie chart, click (Restore).

f. In the dual axis bar chart, click the bars for Yes.

g. In the pie chart, click the slice for 30–44 years (orange slice). The dual axis time series plot should resemble the following:

h. At the top of the report, click the Delivery Analysis tab to make the page active.

i. In the drop-down list control, select Madrid.

The bubble for Madrid is highlighted in the bubble plot, and the dual axis bar chart is filtered to show profit and orders by month for Madrid.

Looking at the bubble plot, you can see a positive association between the number of orders and the days to delivery for Madrid. As the number of orders increase, so does the time it takes to receive the delivery. Looking at the dual axis bar chart, you can see that the number of orders peak around the summer and winter months. This could indicate more interest in buying sports and outdoor products during this time. However, notice that profits spike in August and December. Why are profits so much higher in those specific months?

j. In the upper right corner, click (Menu) and select Close to close the report.

Practice 4.3

1. Working with Prompts and Actions

a. Open the browser and sign in to SAS Viya.

b. Open the VA1- Practice4.2b report from the Courses/YVA185/Basics/Practices (HR) folder.

c. Add a report prompt that uses a button bar to select the employee status.

d. Modify the following options for the button bar:

Name

Employee Status Selector

Title

Select an employee status:

The button bar should resemble the following:

e. Add the following actions between objects on the Employee Analysis page:

- The geo map filters the bar chart and the dual axis bar-line chart.

- The bar chart highlights the dual axis bar-line chart.

f. On the Profit Analysis page, add a rank to the list table to show the top five employees by Total Profit.

Hint: Add a rank for all visible categories. The list table should resemble the following:

The Profit Analysis page should resemble the following:

g. Save the report.

h. View the report and answer the following questions:

Which job title has the highest average profit among active employees in Australia?

Answer:

For Orion USA, which active sales representative had the highest total profit generated for the Indoor Sports group?

Answer:

For Orion France, how many active sales representatives sold items for the Racket Sports group?

Answer:

i. Close the report.

Adding Links

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.

Figure 4.7: Adding Page Links

Linking has elements of both a filter and an action. A page that is the target of a link is filtered by the values selected in the linked report object.

If the source and the target use the same data source, an automatic filter is passed through the link. If the source and the target use different data sources, you have the ability to map data sources, so a filter is passed through the link.

Figure 4.8: Adding Report Links

If the destination report contains multiple pages, then when you define the link, you can choose the initial page of the destination report that opens first.

Figure 4.9: Adding URL Links

If the source and the target of the link use the same data source, an automatic filter is passed through the link. In this example, a page link was added to the report. Double-clicking the bubble for Spain opens another page in the same report and subsets the page to show details about Spain. In this example, a report link was added to the report. Double-clicking the bubble for Spain opens another report and subsets the report to show details about Spain. 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. In this example, a URL link with parameters was added to the report. Double-clicking the bubble for Spain opens the Wikipedia page for Spain.

Demo 4.4: 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.

1. From the browser window, sign in to SAS Viya.

2. In the upper left corner, click (Show list of applications) and select Explore and Visualize . SAS Visual Analytics appears.

3. Click All Reports.

a. Navigate to the Courses/YVA185/Basics/Demos (Marketing) folder.

b. Double-click the VA1-Demo4.2c report to open it.

4. Change the name of Page 3 and hide the page.

a. Click the Page 3 tab to make the page active.

b. Double-click the Page 3 heading to make it editable.

c. Enter Customer Details and press Enter.

d. Click (Options) and select Hide page to make the page hidden.

Note: Hidden pages do not appear when viewing the report unless they are linked to.

5. Modify the size of the hidden page.

a. In the right pane, click Options.

b. In the General group, for the Window width (percentage) field, enter 75.

c. For the Window height (percentage) field, enter 75. The Options pane should resemble the following:

6. Add links between objects.

a. Click the Customer Order Analysis page to make it active.

b. In the canvas, click the pie chart to make it active.

c. In the right pane, click Actions.

d. In the Actions pane, expand Page Links.

e. Select Customer Details.

The Actions pane should resemble the following:

7. Save the report.

8. View the report.

a. In the upper left corner, click (View report) to view the report.

b. In the button bar, select Internet Sale.

c. In the dual axis bar chart, select Yes.

d. In the pie chart, double-click the slice for 45–59 years (green slice).

The Customer Details hidden page appears as a pop-up window and shows details about female customers in the 45-59 age group who placed orders via the internet.

e. In the list table, select the row for Ada Harsen. The hidden window should resemble the following:

Ada seems to place a lot of orders in the same time frame (fall). Why does she place orders during the same time period? Does her birthday or a friend’s birthday fall near this time? If so, we might want to try to offer her discounts at other times of year to increase her orders.

f. Click Close to close the hidden window.

g. In the upper right corner, click (Menu) and select Close to close the report.

Practice

1. Working with Hidden Pages and Page Links

a. Open the browser and sign in to SAS Viya.

b. Open the VA1-Practice4.2c report from the Courses/YVA185/Basics/Practices (HR) folder.

c. Hide Page 3 and rename the page as Employee Details.

d. Modify the following options for the hidden page, Employee Details:

Window width (percentage)

75

Window height (percentage)

75

e. Add a page prompt to the Employee Details page that uses a slider control to select a range of values for years of service.

f. Modify the following options for the slider control:

Object: Name

Years of Service Selector

Object: Custom Title

Select a range of years:

Slider: Act on aggregated data in filtered objects

<selected>

Slider: Minimum

0

Slider: Maximum

45

Hint: Select the entire range of years for the slider control. The slider control should resemble the following:

The Employee Details page should resemble the following:

g. Add a page link from the bar chart on the Employee Analysis page to the Employee Details page.

h. Save the report.

i. View the report and answer the following questions:

How many employees retired in Italy with the Sales Rep. III job title?

Answer:

Management has decided to start promotions with active employees in the United States with the Sales Rep. I job title. Of the active employees with 25 or more years of service, how many generate a total profit more than $200,000?

Answer:

j. Close the report.

4.4 Working with Display Rules

Display rules enable you to use colors to identify specific areas of interest. Display rules can be added for a specific object or to the entire report.

Table 4.3: Display Rules

Display Rule

Description

Expression

Expression display rules are based on the value of a measure data item. For a list table, the expression display rule can be applied to the measure used in the expression, to another column in the table, or to the entire row. Crosstabs accept only expression display rules. If the crosstab contains a hierarchy or totals and subtotals are displayed, you can specify the hierarchy levels or intersections where the display rule will be applied.

Color-mapped values

Color-mapped values display rules are based on the value of a category data item. For a list table, the color-mapped values display rule can be applied to any column in the table or to the entire row.

Gauge

Gauge display rules are based on intervals for a measure data item. For a list table, the gauge display rule can be added to any column in the table. The display rule can be displayed to the left or to the right of the value, or it can replace the value.

Graph Level

For most graph objects, 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 the graph, the display rule can be applied to the background of the graph (shown in Figure 4.10) 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. In this example, an expression display rule indicates which categories produce low, medium, or high average profits. Color-mapped values display rules are based on the value of a category data item (shown here). These display rules are excellent for associating colors with specific values. (For example, coal is gray.) They can be used to add consistency to your reports. In this example, a color-mapped values display rule is applied to color the group sports brown, individual sports blue, and other items gray.

Figure 4.10: Graph-Level Display Rules

Table Level

Display rules can use colors in table objects 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.

In the example shown in Figure 4.11, an expression display rule indicates which product lines and order types have profits below $50,000. Color-mapped values display rules are based on the values 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. (For example, coal is gray.) They can be used to add consistency in your reports. In Figure 4.11, a color-mapped values display rule is applied to color the outdoors line orange and the sports line blue. 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. In this example, a gauge display rule indicates which product lines and order types have low, medium, or high order numbers.

Figure 4.11: Table-Level Display Rules

Crosstabs, on the other hand, only accept expression display rules. In Figure 4.12, an expression display rule highlights profits that are less than $100,000 for specific order types and years.

Figure 4.12: Crosstab Table-Level Display Rules

Report Level

A report-level display rule applies to all objects in the report.

Figure 4.13: Report-Level Display Rules

Demo 4.5: Working with Graph-Level Display Rules

This demonstration illustrates how to add graph-level display rules in Visual Analytics.

1. From the browser window, sign in to SAS Viya.

2. In the upper left corner, click (Show list of applications) and select Explore and Visualize. SAS Visual Analytics appears.

3. Click All Reports.

a. Navigate to the Courses/YVA185/Basics/Demos (Marketing) folder.

b. Double-click the VA1-Demo4.3 report to open it.

4. Add a custom sort for Order Type.

a. In the left pane, click Data.

b. Right-click Order Type and select Custom sort.

The Add Custom Sort window appears.

i. Double-click the following values, in order, to add them to the Sorted Items list:

Retail Sale

Catalog Sale

Internet Sale

ii. Click OK.

The button bar, in the page prompt area, is updated to reflect the custom sort.

5. Change the style of the button bar.

a. In the page prompt area, select the button bar.

b. In the right pane, click Options.

c. In the Button Bar group, for the Background color field, click (Select a color).

d. Select Pale blue.

e. For the Background selection color field, click (Select a color).

f. Select Gray.

The button bar should resemble the following:

6. Change the color of a slice in the pie chart.

a. In the canvas, click the Number of Orders by Custer Age Group pie chart to make it active.

b. In the right pane, click Options.

c. Expand the Style group.

d. In the Fill section, select the yellow box and change the color to Deep gray.

e. For the Data skin field, select Flat.

The pie chart should resemble the following:

7. Add a display rule to the list table on the Customer Details page.

a. Click the Customer Details page to make it active.

b. In the canvas, click the list table to make it active.

c. In the right pane, click Rules.

d. In the Display Rules pane, select New rule Profit.

i. In the New Display Rule window, for the Rule Type field, verify that Expression is selected.

ii. For the Operator field, select < (less than).

iii. For the Value field, verify that 0 is specified.

iv. In the Format area, click (Select a font color).

v. Select Red.

vi. For the Background color field, click (Select a background color).

vii. Select Light gray.

viii. For the Placement field, verify that Row is specified.

The New Display Rule should resemble the following:

ix. Click OK.

The Display Rules pane should resemble the following:

e. If necessary, scroll down in the list table to find a row where Profit is less than 0.

8. Save the report.

9. View the report.

a. In the upper left corner, click (View report) to view the report.

b. At the top of the report, click the Customer Order Analysis tab to make the page active.

c. In the button bar, select Retail Sale.

The geo map should resemble the following:

There are no retail sales in a number of countries because we have stores in only a few countries: Australia, Belgium, Denmark, France, Germany, Italy, Netherlands, Spain, United Kingdom, and United States. If we wanted to expand our retail stores to new countries, Canada might be a logical choice.

d. In the button bar, select Internet Sale.

The geo map should resemble the following:

A display rule has been added to the geo map to show countries with more than 100,000 orders as dark blue. Currently, only the United States has more than 100,000 orders.

However, notice that, through the internet, we can reach more countries and more customers. Perhaps we can start marketing campaigns in South America as we currently have no customers in that continent.

e. In the geo map, select Saudi Arabia.

The page updates, and the other objects are filtered to show product orders in Saudi Arabia.

f. In the upper right corner of the dual axis bar chart, click (Maximize).

In Saudi Arabia, profits are higher for loyalty members. This is one of the only countries where orders placed by non-loyalty members are more profitable than those placed by loyalty members. What is Saudi Arabia doing to generate this behavior? Are they targeting their marketing campaigns toward non-loyalty members? Why would they do this? This might be something to investigate to try to increase profits from loyalty members in this country.

g. In the upper right corner of the dual axis bar chart, click (Restore).

h. In the geo map, double-click Canada.

The Delivery Analysis page is displayed and filtered to show information about Canada.

The monthly profits and orders in Canada seem to follow a similar trend to other countries (higher in the summer and winter months). However, it is interesting to note that there seems to be a strong uptick in profits in December. Why does this happen?

i. In the drop-down list control, select Calgary.

The page is updated to resemble the following:

Internet orders placed in Calgary do not always produce a profit. Most notable is the negative profits in both April and July, even though orders are quite high for those months.

Conversely, profits in November and December are high even though the number of orders are pretty low. Is it the types of items that are ordered in those months that are creating this phenomenon?

j. At the top of the report, click the report name (VA1-Demo4.3) to return to the page.

k. In the dual axis bar chart, select Yes.

l. In the pie chart, double-click the 75 and above slice (gray slice).

The Customer Details hidden window appears and shows details about Canadian loyalty customers in the 75 and above age group who placed orders via the internet.

m. In the list table, select the row for Julie Barham.

Julie has placed a number of orders through the internet but has generated a negative profit for the company. It might be worth investigating the orders to understand why this occurs.

n. Click Close to close the hidden window.

o. In the upper right corner, click (Menu) and select Close to close the report.

Practice 4.5

1. Working with Report-Level and Graph-Level Display Rules

a. Open the browser and sign in to SAS Viya.

b. Open the VA1-Practice4.3 report from the Courses/YVA185/Basics/Practices (HR) folder.

c. Add a report-level display rule for job title by assigning the following colors to the values:

Job Title

Color

Sales Reps I, II, III, IV

Deep blue

Temp. Sales Rep, Trainee, Purchasing Agent I, Purchasing Agent III

Deep orange

The Employee Analysis page should resemble the following:

d. Add three expression display rules to the bar chart on the Profit Analysis page by assigning the following colors to the ranges of Total Profit:

Total Profit Ranges

Color

Total Profit < 200,000

Red

200,000 <= Total Profit <= 500,000

Yellow

Total Profit > 500,000

Green

Note: Apply the display rule to the bars of the chart.

The Profit Analysis page should resemble the following:

e. Save the report.

f. View the report and answer the following questions:

How many employees retired in Spain? How many retired with the Sales Rep. I job title?

Answer:

View the Profit Analysis page. Among active employees in Orion Spain, how many groups generated a total profit above $500,000?

Answer:

g. Close the report.

Quiz 4.1

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

a. Bubble plot

b. Pie chart

c. Bar chart

d. Treemap

..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset
3.12.36.30