SAS Visual Analytics Hands-On Insight Toys

Size: px
Start display at page:

Download "SAS Visual Analytics Hands-On Insight Toys"

Transcription

1 SAS Visual Analytics Hands-On Insight Toys Elson Filho March, 2016

2 Copyright and Trademark Information Copyright 2015 SAS Institute Inc., Cary, NC, USA. All Rights Reserved. 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.

3 Index Description... 4 Data... 4 Data Dictionary... 4 Goals... 6 Exploration... 6 Reporting... 6 SAS Visual Analytics... 7 Exploration... 8 Verify the data set details... 8 Analyse the Sites Analyse the Products Analyse the Sales Evolution Analyse Customer Satisfaction Reporting Management Report Appendix A Data Items adjustments, Hierarchies and Geographies Answers from Exercises SAS Visual Analytics User Community VA Hands-On_Script_4.03.docx page 3

4 Description The Insight Toys Company is an organization that manufactures toys at different production sites worldwide. We are trying to find ways to be more competitive and are striving to increase customer satisfaction. Managers of finance department need to better understand profitability and sales issues. Data The INSIGHTTOY_SALES data set, contains 57 variables and 1,416,058 observations. It represents the historic transactional data from the company start. For each transaction we have: Information on the items sold (Product Brand, Line, Make, Style, SKU); The sale value (Order Total); Various related costs (Distribution, Marketing, Product); Information on the sales representative (Rating, Target, Actual, etc.); Geographic information (xyfacility Lat, xyfacility Lon, xy, etc.); Information on the vendors (Rating, Satisfaction, Distance to nearest facility); Text Notes taken at the moment of the order taking, based on conversation with the customer (vendor). Data Dictionary Name Type Class Description Facility Character Category Unique identifier of the selling facility Facility City Character Category City where the selling facility is located Facility Continents Character Category Continent where the selling facility is located Facility Country/Region Character Category Country where the selling facility is located Facility Country/Region Code Character Category Unique 2-letter code for each country Facility Date Closed Date Category If a facility were ever to be closed, none are in this dataset Facility Date Opened Date Category Date the manufacturing facility was opened, varies from 1980 to 2010 Facility State/Province Character Category State or Province where the selling facility is located Manufacturing Batch Character Category Manufacturing batch corresponding to each transaction Manufacturing Batch SKU Character Category Stock Keeping Unit of various Manufacturing Batches Manufacturing Facility Character Category Identifier and location of the manufacturing facility Order Character Category Unique identifier of the order Order note Character Document Collection Free form text notes taken at the moment the vendor ordered items. This can be used in Text Analytics Product Brand Character Category 2 brands of products: Novelty and Toys Product Line Character Category 8 lines of products, falling in the two product brands Product Make Character Category 77 product make, falling into the 8 product lines Product SKU Character Category 779 product SKUs produced, falling into the various product styles Product Style Character Category 355 product styles, falling into the various product makes Sales Rep Character Category Identification of the sales representative who made the sale Transaction Date Date Category Date of the sale Transaction Day of Week Date Category Day of the week of the sale Transaction Month of Year Date Category Month of the sale Vendor Character Category Identifier and location of the vendor (customer) VA Hands-On_Script_4.03.docx page 4

5 Vendor Date Ended Date Category When the vendor stopped doing business with us Vendor Date Started Date Category When the vendor started doing business with us Vendor Loyalty Program Character Category Vendor Type Character Category Market Penetration Numeric Measure Binary field (Y/N) representing whether or not this vendor is in our loyalty program 5 types of vendors: Convenience store, Discount store, Department store, Kiosk or Other For each transaction, the corresponding % of market share in that particular region at that time. Order Distribution Cost Numeric Measure Distribution cost associated with that transaction Order Marketing Cost Numeric Measure Order Product Cost Numeric Measure Order Sales Cost Numeric Measure Order Total Numeric Measure Revenue from that sale Sales Rep % of Target Numeric Measure Sales Rep Actual Numeric Measure Marketing cost assigned to that transaction (through an activity-based costing exercise) Direct manufacturing costs associated with that transaction. Included I the calculation of gross Margin Sales-related costs assigned to that transaction (through an activity-based costing exercise) A ratio of Sales Rep Actual sales divided by Sales Rep target. Calculated DAILY Cumulative DAILY sales for each sales representative. This value should not be summed across the transactions (since it has already been aggregated) Sales Rep Orders Numeric Measure Number of orders assigned to the sales representative on a given period. Sales Rep Rating Numeric Measure Sales Rep Target Numeric Measure Sales Rep Vendor Base Numeric Measure Sales Rep Vendors Numeric Measure Subjective evaluation of the sales representative by the vendors - from 0% to 100%. Daily sales Target (goal) for each sales representative. This value should not be summed across the transactions (since it has already been aggregated) Potential revenue (funnel) from all the vendors assigned to a sales representative. This value should not be summed across the transactions (since it has already been aggregated) Number of vendors assigned to a sales representative. This value should not be summed across the transactions (since it has already been aggregated) Vendor Distance Numeric Measure Distance from the vendor location to our selling facility Vendor Rating Numeric Measure Vendor Satisfaction Numeric Measure Subjective evaluation, from 0% to 100%, representing the potential value of a customer (vendor) for insight Toy. Satisfaction of the customer (vendor) based on a marketing survey. From 0% to 100%. xyfacility City Lat Numeric Measure Latitude of the city where the selling facility is located xyfacility City Lon Numeric Measure Longitude of the city where the selling facility is located xyfacility Continent Lat Numeric Measure Latitude of the continent where the selling facility is located xyfacility Continent Lon Numeric Measure Longitude of the continent where the selling facility is located xyfacility Country/Region Lat Numeric Measure Latitude of the country where the selling facility is located xyfacility Country/Region Lon Numeric Measure Longitude of the country where the selling facility is located xyfacility Lat Numeric Measure Latitude where the selling facility is located xyfacility Lon Numeric Measure Longitude where the selling facility is located xyfacility State/Province Lat Numeric Measure Latitude of the state where the selling facility is located xyfacility State/Province Lon Numeric Measure Longitude of the state where the selling facility is located xymanufacturing Facility Lat Numeric Measure Latitude where the manufactory facility is located xymanufacturing Facility Lon Numeric Measure Longitude where the manufactory facility is located xyvendor Lat Numeric Measure Latitude where the vendor is located xyvendor Lon Numeric Measure Longitude where the vendor is located VA Hands-On_Script_4.03.docx page 5

6 Goals Exploration Verify the data set details Analyse the sites Where do our Revenues and Gross Profit come from? Analyse the Products What is the Revenue generated by each product and product groups? What is their profitability? Analyse the evolution of the company and create a forecast How sales and profits have developed in recent years? What is the forecast for the next 24 months? Scenario Analysis (What If) - How does an increase in marketing spending would affect our forecast? Analyse Customer Satisfaction How has Customer Satisfaction developed in recent years? What is the forecast for the next 12 months? What factors affect our customer s satisfaction? What are the characteristics of our most satisfied customers? Which topics were discussed in the comments on the Order Notes? Reporting Management Report Create a report for the managers of different departments. VA Hands-On_Script_4.03.docx page 6

7 SAS Visual Analytics We will be using the Teradata University Network in these exercises, we assume you are registered ( know how to access SAS VA (otherwise, please check this document), and have some familiarity with SAS Visual Analytics (it is highly recommended to do the Assignments 1 and 2, here). Get into the VA Hub. Click on Browse, find the InsightToys folder (SAS Folders/Shared Data/SAS Visual Analytics/Public/ LASR/InsightToys), and open the exploration: InsightToy_Exploration1. ALTERNATIVE: The InsightToy_Exploration1 was prepared with some adjustments on the data items and with the definitions for Hierarchies and Geographies. So students can quickly start their analysis. If you want (or need) to create your exploration from scratch you must follow this steps: Click on Data Explorer. Click on Select a Data Source and select the INSIGHTTOY_SALES data source. Conduct the steps on Appendix A Data Items adjustments, Hierarchies and Geographies. VA Hands-On_Script_4.03.docx page 7

8 Exploration SAS Visual Analytics Explorer enables you to explore your data sources (in-memory tables from the SAS LASR Analytic Server) by using interactive visualizations such as charts, histograms, and tables. You can also apply data analysis such as forecasting, correlation, and fit lines. You can also perform statistical modeling tasks in the explorer. Verify the data set details Now you are ready to start your exploration! At the left of the screen the data items on the data set are displayed, the numbers indicate the number of different occurrences, and the properties of the data items are represented by icons, as showed below. or Aggregated Measure or Time Period Calculation Calculated (Category, Date, or Measure) Category Category with a user-defined format Date and Time Geography Hierarchy Measure Unique identifier You can manage the properties for individual data items by using the Data pane or manage the properties for all of your data items by using the Data Properties window. You can modify the properties of the data items. The changes that you make are saved as part of the exploration, but do not affect the original data source. VA Hands-On_Script_4.03.docx page 8

9 Hands-on Exercise 1: Click on Options and verify the available options. Check the Data Source Details, the Data Properties and Measure Details. 1) How many observations are there in the INSIGHTTOY_SALES dataset? 2) How many data items (or variables, or columns) are there? 3) Quickly, verify the distributions and main statistics of each measure variable. What are their average values? VA Hands-On_Script_4.03.docx page 9

10 Analyse the Sites On the characteristics of the category variables, we can see that Insight Toys manufacture 779 different products (Product SKU) at 130 facilities (Facilities). Where do our revenues and profits come from? In order to display data on a map, the locations to be displayed must be provided with longitude and latitude information (in our exploration this was already prepared). Now create a new visualization with Country Hierarchy, Order Total and Gross Profit Margin. The size of the dots represents the Revenues (sum of Order Total) at the respective countries, while the color shows the Gross Profit Margin. It quickly becomes clear that the largest proportion of sales from the United States comes (about 537 million). In fact this is so high, that makes it difficult to visualize on the other countries. We can filter out the United States to make it easier to compare the rest of the world. For this purpose we select the tab Filter on the right and drag the Facility Country/Region to the area for Visualization filters. Notice: Visualization filters affect only the current visualization, while Global filter effect all visualizations within an Exploration. In the lower right corner it is displayed the percentage of the data set that is used for the visualization, in this case, after filtering United States it is only 23%. VA Hands-On_Script_4.03.docx page 10

11 Now let's look at the United States in detail. Select the United States again (or delete the filter) and drill down one level (State/Province) on the United States (double click on the bubble of the United States). You can also see the details in a tabular form using the Show Details button. VA Hands-On_Script_4.03.docx page 11

12 Hands-on Exercise 2: 1) Which city in California has the highest Order Total? 2) Which Brazilian state has the highest Gross Profit Margin? 3) What is the Order Total and Gross Profit Margin in the city of Beijing? 4) What is the Order Total and Gross Profit Margin in the province of Gauteng (South Africa)? 5) Which countries have the lowest Gross Profit Margin in 2013? 6) Which are the top 10 cities with highest Order Total in 2013? Tip: You may need to create a different visualization to check this, e.g.: a Crosstab. Optional: Area map Sales Representative target achievement Create an area map with the Sales Rep %of Target, with the Visualization filtered by Transaction Data Year = Change the map style to Regions. Notice: Region maps (also known as a choropleth map) requires a geography variable with the role type of geography and it does not support custom geography data items. Our Facility Country/Region geography variable was created using Country or Region Names (on the dataset it was provided as the standard ISO country names). VA Hands-On_Script_4.03.docx page 12

13 Analyse the Products Now let s verify the sales and profit margins generated by the products on our portfolio. For this purpose a Treemap chart is ideal. So, open a new visualization and tap Treemap. Then, select sequentially (with the Ctrl key) the data items: Product Hierarchy, Order Total and Order Margin, and drag them to the chart. On Properties you can change the Color Gradient to be easier to visualize it. We are seeing the sum of revenues and margins on our 2 Product Brands: Toy and Novelty. Now drilldown on Toy to see these metrics on the Product Lines of the Toy brand. Drilldown again on Game, and you see its Product Make. You can observe big differences here. VA Hands-On_Script_4.03.docx page 13

14 A box plot can help to visualize the distribution of our revenues and profits. Make a copy (duplicate) of the current visualization. Then change the visualization to a Box plot using the icon in the upper left window title bar Notice: using the context menus (right-click on the visualization) you can select to Show Outliers and Averages. A double click on the outliers of the box plots show the detailed distribution of outlier values this measure number. VA Hands-On_Script_4.03.docx page 14

15 Hands-on Exercise 3: 1) Which Super Hero Figure toy generated the highest Order Total and Order Margin? And the lowest? 2) What are Order Total and Order Margin of small cats plush? 3) Apparently our Novelty Thrift Clip(s) are not generating much revenues. Are there some styles generating higher revenues? 4) We are doing very well with our third generation of Board Games. Which one generated the highest Order Total and Order Margin? 5) Which are the top 5 products (Product SKU) in terms of revenue (Order Total) in 2013? And the bottom 5 products? Tip: Create a Bar chart. VA Hands-On_Script_4.03.docx page 15

16 Analyse the Sales Evolution Now let s verify how sales have developed in recent years. Create a new Visualization, by clicking on, select Transaction Date Year, Order Total and Order Product Cost and drag them to the visualization area. SAS Visual Analytics automatically selects the best representation for this data, in this case a Line Chart. And now you can change or adapt as you like it, for instance by modifying the measure layout to Shared Axis (on Properties). We can see how these two financial metrics have evolved in the last few decades. But, if we want to see them in a monthly basis? Simply drag Transaction Month Year into the X-axis label to replace it. And the visualization will be recalculated immediately with the monthly figures. We can now see a strong seasonality. To be easier to visualize it, only a certain portion of the time series is displayed. In our specific case, the period from April 2000 to October VA Hands-On_Script_4.03.docx page 16

17 With the scroll bar you can zoom in or out the displayed time series. Move the left or right controller back and forth to see the periods you are interested in. In order to move both controllers simultaneously, you can rotate the mouse wheel. Try it out! We also want to know the forecast for the next months, so check Forecasting (on Roles), by default it generates the forecast for the next 6 months. As you can see it added a line with predicted values to your visualization and a colored band that represents the confidence interval, in this case 95% confidence interval. Notice: The explorer automatically tests multiple forecasting models for your data, and then selects the best model. To see which forecasting model was used, click on forecast model can be any of the following: Damped-trend exponential smoothing Linear exponential smoothing Seasonal exponential smoothing Simple exponential smoothing Winters method (additive) Winters method (multiplicative) at the visualization legend. The Hands-on Exercise 4: 1) What is the forecast of Order Total for the next 24 months? Tip: Exclude Order Product Cost and change the Forecast duration on Properties. 2) Which method was used to generate this forecast? 3) Accordingly to this forecast, what would be the Order Total in December 2013? And December 2014? VA Hands-On_Script_4.03.docx page 17

18 We can try to improve accuracy of the forecast by adding other measures as Underlying factors. The forecasting model evaluates the additional measures to determine whether they contribute to the accuracy of the forecast. Now, include Order Marketing Cost, Sales Rep Rating and Vendor Satisfaction in our forecasting as Underling Factors. See how the confidence bands narrowed and that Order Marketing Cost and Sales Rep Rating contributed to this forecast, while Vendor Satisfaction didn t (and wasn t used grayed out). Now our forecast includes underlying factors, so we can apply scenario analysis and goal seeking to this forecast. Launch Scenario Analysis to forecast hypothetical scenarios by specifying future values for underlying factors that contribute to the forecast. Suppose we would increase Marketing investments by 20%, what would be our sales forecast? Right click on the Order Marketing Cost series and select Set Series Values, then select Adjust series values by percentage and set it to 20%, finally click Apply. VA Hands-On_Script_4.03.docx page 18

19 We can observe that the sales forecast would be higher. Let s reset it for now, click the measure heading on the plot, then select Reset Entire Series and apply. Now, suppose we had a target for Order Total of $ 8 million in December 2014, how much we should invest in Marketing in order to achieve this goal? Select Order Marketing Cost as an underlying factor to optimize, and click on table view, it would be easier to set a value, and enter our target: Click Apply. Go back to the chart view. In order to achieve our $8 million goal in December 2014, we need to invest $374,581 in Marketing (small variations on this result are expected). VA Hands-On_Script_4.03.docx page 19

20 Please reset it again by clicking in one of the measures headings on the plot, and then select Reset Entire Series and close it. Hands-on Exercise 5: 1) We want to increase our forecast of Order Total by $ 1 million every month for the next 24 months. How much we should invest in Marketing in order to achieve this goal? VA Hands-On_Script_4.03.docx page 20

21 Analyse Customer Satisfaction Now let s verify how our Customer Satisfaction has developed in recent years. Create a new Visualization, select Transaction Month Year and Vendor Satisfaction and drag them to the visualization area, change the visualization to a Line chart. We can see that the satisfaction is not great (around 57%), we can also forecast it for the next 12 months, and it wouldn t be better. Our marketing department is convinced that Vendor Satisfaction is key to improving our sales, but it is necessary to understand what impacts customer satisfaction. VA Hands-On_Script_4.03.docx page 21

22 Let s verify how Vendor Satisfaction is correlated with the other measures. Create a new visualization, select all measures and drag them into the visualization. It automatically decided to create a Correlation Matrix. We can focus our attention to the last row (Vendor Satisfaction), we can see that its strongest relationship is with Sales Rep Rating. Double click on that cell and a new heat map visualization will display the two measures from our selected cell. We can see it is a strong positive linear relationship (Correlation: 0.973). Hands-on Exercise 6: 1) Which are the 3 measures with the strongest correlations with Vendor Satisfaction? What are their correlations? VA Hands-On_Script_4.03.docx page 22

23 On a different approach, we can use a predictive model, like a Decision Tree, to better understand what impacts customer satisfaction, but also to verify the characteristics of our most satisfied customers. Previously, it was created a Custom Category named Satisfaction, by categorizing as Good the cases where Vendor Satisfaction is between 55% and 100%. We can see it using two visualizations, one for Satisfaction and another one for Vendor Satisfaction. Then using the Data brushing and selecting the Good on Satisfaction we can see on the Distribution of Vendor Satisfaction where they are. A decision tree creates a segmentation of the data based on a series of rules. Each rule assigns an observation to a node based on the value of one predictor. Rules are applied sequentially, which results in a hierarchy called a tree. The initial node contains the entire data set and is called the root node. A node and all of its successors form a branch. The final nodes are called leaves. For each leaf, a decision is made about the response variable. A decision tree is a supervised Predictive Model, in the sense that it requires one Target variable and at least one predictor. The Target can be a category variable (Classification Tree) or a measure variable (Regression Tree). A predictor can be a category or measure variable. A decision tree will be automatically built, but you can also manually train it and prune nodes in the interactive mode. Create a new visualization and select the Decision Tree. Drag Satisfaction to the visualization or to Response in the roles tab. Now we need to add variables that may influence it, let s include the ones with highest correlations, but also some other variables (not only measures) that we suspect would influence it, accordingly to our domain expertise. Select: Marketing Penetration, Order Sales Cost, Sales Rep Rating, Vendor Distance, Vendor Rating, Vendor Loyalty Program and Facility Continents and drag them to Predictors. VA Hands-On_Script_4.03.docx page 23

24 We can see the variables selected by the Decision Tree, interestingly Vendor Loyalty Program and Vendor Rating (grayed) were not included. As we zoom in our Decision Tree, we can see the first branch used Sales Rep Rating and split it at 52%. Those greater or equal to 52% present Good satisfaction rates in 98.2% of the cases. Those with less than 52% present Bad rates in 86.57% of the cases. Growing the Tree, by further subdividing the cases, we can obtain a more complete and accurate model. By looking at the leaves (mouse over) we can quickly check its rules and statistics. On Properties select Show diagnostic plots and change Frequency to Percent. VA Hands-On_Script_4.03.docx page 24

25 With the Diagnostics Plots we can see Leaf Statistics and Assessment windows. The Leaf Statistics window plots the frequency or percentage of each observation in each leaf node. The most common level in a node is the predicted value assigned to that node. The Assessment window plots lift, ROC, and misclassification rates, we can use those to determine how well the model fits the data. Lift is the ratio of the percent of captured responses within each percentile bin to the average percent of responses. Similarly, cumulative lift is calculated by using all of the data up to and including the current percentile bin. A receiver operating characteristic (ROC) chart displays the ability of a model to avoid false positive and false negative classifications. And the misclassification plot displays how many observations were correctly and incorrectly classified for each value of the response variable. Hands-on Exercise 7: 1) How many leaves do we have? 2) View the Leaf Statistics. Which is the purest leaf? What is rule associated with that leave? 3) View the ROC chart. What is the KS Statistic? 4) View the Misclassification Chart. How many false negatives are there? This Decision Tree model seems quite accurate and provides easy rules to understand Customer Satisfaction. VA Hands-On_Script_4.03.docx page 25

26 In a different attempt to understand Customer Satisfaction, Insight Toy has been collecting an Order Note for each order. When the customers express some feedback or comment, the Sales Representative enter them on those notes, in a free text format. The Marketing department intended to categorize those notes and then search for potential problems they should look into, but also to verify the customer sentiment. Unfortunately, due to the high volume of notes, the Marketing department has been unable to analyse them, until now. SAS Visual Analytics also provides the Word Cloud, to display a set of words from a character data item, or a document collection. Depending on the type of word cloud and your data roles, the size of each word in the cloud can indicate the importance (topic term weight) of the word, the frequency of the word, or the value of a measure. Word clouds that use text analytics analyze each value in a document collection as a text document that can contain multiple words. Words that often appear together in the document collection are identified as topics. For a selected topic, the word cloud displays the terms with the greatest topic term weight values (importance of the term within the topic). A word cloud can also display whether the documents in a topic express positive, negative, or neutral sentiment. Let s look at the Order Notes of 2013, in a new visualization select Word Cloud Date Year into Filter Visualization and select the year 2013 (only).. Drag Transaction In Roles Document collection, select Order Note. VA Hands-On_Script_4.03.docx page 26

27 We can see in the initial results that the Text Analytics categorization algorithm identified 20 topics by grouping important terms in this document collection. The first topic (+place, plush, game, +dissatisfy) and it is present on 10,120 documents. The term place presents a Topic Term Weight of We can read the Order Notes with this term on the tab Documents. Hands-on Exercise 8: 1) Verify the term dissatisfy. What is its Topic Term Weight on the first topic? View some Documents where it is present. 2) Is this term dissatisfy also presented on other topics? If so, what is its Topic Term Weight? VA Hands-On_Script_4.03.docx page 27

28 It seems that 20 topics can be considered too many for the Marketing analysis purpose and they interest on Satisfaction, so let s incorporate Sentiment Analysis and reduce the number of topics. On Properties, Text Analytics Setting, on Word display limit drag the slider to 25 and select Advanced. Check Analyze document sentiment. Set the Maximum topics to 5 and Resolution to Medium, with these settings it would identify fewer topics. Select: Include parts of speech and Extract noun groups. Verify that Use entity extraction is not selected, but Stem words and Use stop list are already selected. Hands-on Exercise 9: 1) How many topics were found? 2) Which topic present more documents with negative sentiments? Which are the top 5 terms (regarding Topic Term Weight) on this topic? 3) Select the term dissatisfy and inspect the documents with higher negative sentiments. We can select some cases for further investigation. From the last exercise, with the term dissatisfy selected, choose some documents, e.g. right-click to select all (and unselect one of them), and Create Visualization from the Selected Documents. VA Hands-On_Script_4.03.docx page 28

29 On this new visualization we can incorporate other information, like: Vendor, Facility Country, Facility State. On another example, we can present the frequency of this problematic Order Notes, involving the term dissatisfy. Just duplicate this Visualization, transform it into a Crosstab, remove the Order Notes and order by Frequency. VA Hands-On_Script_4.03.docx page 29

30 Reporting The SAS Visual Analytics Designer enables users to easily create reports or dashboards without the need to understand a programming language. The reports that can be viewed on either a mobile device or in the Viewer (in a web browser). Management Report Finance managers need to monitor continuously the sales in each country, including revenues and profitability. Product Line managers want to check vendor satisfaction, market penetration, costs and revenues per product. And Customer Relationship managers want to check vendor satisfaction and rating in each country, but also the performance of their sales representatives. This report was created previously, now open the InsightToy_Report, in the Viewer. This report is divided into three sessions (sections are like pages), Sales Overview, Products Overview and Vendors Overview. Focusing on our different business needs. Please explore this report at your will, and do it more thoroughly when you have time. Observe how filters and dynamic filters are used and how the objects are linked to each other. VA Hands-On_Script_4.03.docx page 30

31 Hands-on Exercise 10: 1) In 2013, what was the revenue (Order Total) in Brazil? Which proportion is it in South America? On which month it reached the lowest point? And which product line presented the highest Gross Margin Ratio? 2) In August 2013, which Beach Product had the best Vendor Satisfaction rate? What was the Revenue (Order Total) and Market Penetration with that product then? 3) In Europe, 2012, which country presented the highest Vendor Satisfaction? And Vendor Rating? And where Sales Representatives generated the highest revenues? The Commercial Directors requested to include indicators to enable them to monitor the Sales Representatives performance on each country. So, let s edit this Report and include a new section with the Sales Representatives indicators. On the Menu click on File and select Edit Report, and the Report will be opened on the Designer. Add a new section by clicking in the +. Rename it to Sales Rep Overview. Section prompts are controls that can be placed in the area above the canvas and enables the user to select a value to filter data. Include two Drop-Down Lists on the section prompt, by drag-and-drop from Objects Controls. Assign both as Required. VA Hands-On_Script_4.03.docx page 31

32 Assign Country for one of them and remove the Frequency. Assign Transaction Year for the other, also remove the Frequency. This way, the users will be able to select a year and a country for their analysis. Now, let s create a Chart to analyse how the Sales Representatives are performing and how close they are to their targets. Drag-and-drop the Target Bar Chart from Objects - Graphs into the canvas. Select Sales Rep as Category, Sales Rep Actual as Measure and Sales Rep Target as Target. Select a Year and a Country of your preference to preview your chart. We can adapt the color scheme to emphasize the ones that achieved (or not) their targets. Let s first define the (default) style Data Color Fill. Select a red color shade, accordingly to your preference, for the first fill. VA Hands-On_Script_4.03.docx page 32

33 Then create a new Display Rule as an Expression: Sales Rep Actual >= Sales Rep Target and specify a green color shade. Now let s include a Table to list relevant metrics for each Sales Rep. Drag-and-drop a List Table from Objects - Tables into the bottom part of the canvas. Select: Sales Rep, Sales Rep Actual, Sales Rep Target, Sales Rep Rating, Sales Rep Orders and Sales Rep Vendors. Check if Sales Rep Rating Aggregation is Average. You can also reorder them, e.g. by Sales Rep Actual. VA Hands-On_Script_4.03.docx page 33

34 We can also adapt the color scheme to emphasize some information. Let s create a Display Rule, similarly as the previous one, as an Expression: Sales Rep Actual < Sales Rep Target and specify a red shade font. And create another Display Rule using Gauge type Icon, based on the Sales Rep Rating. Define the intervals as: red: [0, 0.44[, yellow: [0.44, 0.66[, green: [0.66, 1]. Hands-on Exercise 11: 1) Create a new section with a Time Series Plot to show Sales Rep Actual (Year to Date) by Transaction Date, group by Sales Rep. Change the Section to be displayed as Info Window. We will use the result of this exercise in the next step. VA Hands-On_Script_4.03.docx page 34

35 Now let s create interactions, so if the user select a particular Sales Rep in the bar chart, the info in the List Table will be highlighted (Brush) and another interaction to show the Sales Rep Actual (Year to Date) details in the Info Window. On the tab Interactions, click on Interactions View. Then just draw the connection between the two objects and change the Interaction Type to Brush. Now create the connection between the bar chart and the Info Window. Then click on Close. VA Hands-On_Script_4.03.docx page 35

36 Save your Report in your Folder. And open it on the Viewer. Check the interactive functionalities. Hands-on Exercise 12: 1) In 2013, which Brazilian Sales Representatives were above their sales target? Which are their values for Actual, Target and Orders? What are their Ratings? What were their Actual Sales (Year to Date) before the Carnival (February 9, 2013)? VA Hands-On_Script_4.03.docx page 36

37 Appendix A Data Items adjustments, Hierarchies and Geographies Initially the properties of the data items are assigned by default. It is a good practice to verify if some adjustments are needed, but also to define Hierarchies and Geographies data items. If you didn t open the existing pre-prepared Exploration, you should do these adjustments. Set Order as Unique Row Identifier Create Product Hierarchy VA Hands-On_Script_4.03.docx page 37

38 Create Geographies Facility Country/Region (using Country or Region Names). Facility (custom geography, using: xyfacility Lat and xyfacility Lon), Facility City (custom geography, using: xyfacility City Lat and xyfacility City Lon), and similarly: Facility Continents, Facility State/Province, Manufacturing Facility, and Vendor. Hide the xy Lat and Lon items VA Hands-On_Script_4.03.docx page 38

39 Create a hierarchy of the Geographies Facility Geo Hierarchy: Facility Continents, Facility Country/Region, Facility State/Province, Facility City, and Facility. Create a Location Hierarchy Country Hierarchy: Facility Country/Region, Facility State/Province and Facility City. Create Order Margin as a Calculated Item VA Hands-On_Script_4.03.docx page 39

40 Create Gross Profit Margin as an Aggregated Measure Create Satisfaction as Custom Category VA Hands-On_Script_4.03.docx page 40

41 Answers from Exercises Answers Exercise 1: 1) 1,416,058 2) Data items (Columns):50 of 64 (14 data items were hidden). 3) Answers Exercise 2: 1) Oakland: Order Total: 5,797,430. 2) Minas Gerais and Rio de Janeiro: 60%. 3) Order Total: 428,476, GPM: 40.1%. 4) The province of Gauteng is in South Africa, Order Total: 824,144, GPM: 50%. 5) India, Mexico, Indonesia, Saudi Arabia, Egypt and Venezuela with 33.3%. 6) VA Hands-On_Script_4.03.docx page 41

42 Answers Exercise 3: 1) Highest: Ironman. Lowest: Green Hornet. 2) 3) VA Hands-On_Script_4.03.docx page 42

43 4) Rise-and-Fall 5) Top 5: Bottom 5: VA Hands-On_Script_4.03.docx page 43

44 Answers Exercise 4: 1) 2) Winters Method (Additive) 3) VA Hands-On_Script_4.03.docx page 44

45 Answers - Exercise 5: 1) Answers - Exercise 6: 1) Sales Rep Rating: Order Sales Cost: Vendor Distance: Answers - Exercise 7: 1) 12 leaves. 2) VA Hands-On_Script_4.03.docx page 45

46 3) 4) VA Hands-On_Script_4.03.docx page 46

47 Answers - Exercise 8: 1) Topic Term Weight: ) The term dissatisfy is also present on (+dissatisfy, figure, +drop, risk). Topic Term Weight: Answers - Exercise 9: 1) 3 topics: (toy, figure, game, order), (supplier, +drop, risk, unhappy), (novelty, bead, gift, order). 2) (supplier, +drop, risk, unhappy) VA Hands-On_Script_4.03.docx page 47

48 3) (supplier, +drop, risk, unhappy) VA Hands-On_Script_4.03.docx page 48

49 Answers - Exercise 10: 1) Sales Overview Year: 2013 Continent: South America. $960, %. August: $13,090. Game: 56%. 2) Products Overview Beach Year: Vendor slide to August. Sand Castle Kit: 55%. $ VA Hands-On_Script_4.03.docx page 49

50 Products Overview Beach Year: Market slide to August. Market Penetration: % 3) Vendors Overview Year: 2012 Continent: Europe. United Kingdom Vendor Satisfaction: 66%. Sweden Vendor Rating: 51%. United Kingdom Sales Rep Actual: $10,507,959. VA Hands-On_Script_4.03.docx page 50

51 Answers - Exercise 11: 1) Answers - Exercise 12: 1) VA Hands-On_Script_4.03.docx page 51

52 SAS Visual Analytics User Community The SAS Visual Analytics user community is dedicated to users who are focused on exploratory visualization and analytical techniques, data preparation, dashboard reporting, and mobile BI. You can share your experiences, discuss topics and ideas, seek help from your peers, and share information about upcoming events. You can access the user community at support.sas.com/vausercommunity. VA Hands-On_Script_4.03.docx page 52