You are on page 1of 14

Data Visualization

Activities
Contents
Connecting to Your Data ........................................................................................................................................ 3
Activity – Creating a Local Data Connection ...................................................................................................... 3
Objective ........................................................................................................................................................ 3
Directions ....................................................................................................................................................... 3
Detailed Steps ................................................................................................................................................ 3
Working with Your Data ......................................................................................................................................... 4
Activity – Filtering............................................................................................................................................... 4
Objective ........................................................................................................................................................ 4
Directions ....................................................................................................................................................... 4
Detailed Steps ................................................................................................................................................ 4
Activity – Sorting ................................................................................................................................................ 5
Objective ........................................................................................................................................................ 5
Directions ....................................................................................................................................................... 5
Detailed Steps ................................................................................................................................................ 6
Activity – Creating Groups and Hierarchies ....................................................................................................... 6
Objective ........................................................................................................................................................ 6
Directions ....................................................................................................................................................... 6
Detailed Steps ................................................................................................................................................ 7
Activity – Creating Visual Groupings .................................................................................................................. 8
Objective ........................................................................................................................................................ 8
Directions ....................................................................................................................................................... 8
Detailed Steps ................................................................................................................................................ 9
Activity – Creating and using Sets ...................................................................................................................... 9
Objective ........................................................................................................................................................ 9
Directions ....................................................................................................................................................... 9
Detailed Steps .............................................................................................................................................. 10
Working with Special Fields ................................................................................................................................. 11
Activity – Working with Date Dimensions........................................................................................................ 11
Objective ...................................................................................................................................................... 11
Directions ..................................................................................................................................................... 11
Detailed Steps .............................................................................................................................................. 11

2
Connecting to Your Data
Activity – Creating a Local Data Connection
Objective
To be able to create local data sources and articulate the benefits of using them.
Directions
Connect to the TRAINING Superstore Sales.xls data set (Orders Table, Connect Live)
Make the following edits:
 Change Customer No to Dimension
 Rename Customer No to Customer Id
 Format Sales and Profit as currency
 Edit Discount to use the aggregate function Average and change the default format to percentage. Add
the comment “Average Discount Percentage”
 Save the data source to the Tableau Repository as “My Superstore”
 Open a new workbook and connect to the saved data source to view the changes

Detailed Steps
1. Connect to the TRAINING Superstore Sales.xls data source. Connect to the Orders table and choose to
Connect Live.
2. Make the following edits in the data window:
 Right-click Customer No and select Convert to Dimension
 Right-click again and select rename to change to Customer ID
 Change Profit and Sales to use the currency format by right-clicking on the field, choosing Default
Properties>Number Format>Currency (Custom) and selecting 0 decimal places
 Update the Discount Field. Right-click on Discount and choose Default
Properties>Aggregation>Average. Next, right-click on Discount and choose Default
Properties>Number Format>Percentage and choose to display 2 decimal places. Finally, right-click on
Discount and choose Default Properties>Comment and edit the comment to read “Average Discount
Percentage”.
3. Choose Data>Orders (TRAINING Superstore Sales.xls)>Add to Saved Data Sources. Name the data source
“My Superstore” and ensure it is saved in the My Tableau Repository.
4. Close the current workbook, and then open a brand-new workbook. Under “Connect to Data” select the
new “My Superstore” data source and observe the fields that were saved.

3
Working with Your Data
Activity – Filtering
Objective
To apply filters to different types of fields and demonstrate how filters relate to each other and affect the view.
Be able to provide and promote end-user interactivity by adding and customizing Quick Filters.
Directions
Connect to the TRAINING Superstore Sales.xls data set via the saved My Superstore connection
Create a Heat Map with the following steps:
 Customer Segment to Columns, Category to Rows, Sales to Size, and Profit to Color
 Create a Quick Filter on Region and include Central and East.
 Add a Quick Filter on Order Date (Year), displayed as a single value list. Select 2010 as the value.
 Add a Quick Filter on Sum of Profit between -20,000 to 20,000.
 Name the worksheet. Add a Caption and Title. Edit the Tool Tip.
 Save the workbook as “Working with Data”.

Detailed Steps
Connect to the TRAINING Superstore Sales.xls data source. Connect to the Orders worksheet using a live
connection.
Create a Heat Map by completing the following steps:
1. Drag Customer Segment to Columns
2. Drag Category to Rows
3. Drag Sales to Size in the Marks card
4. Drag Profit to Color in the Marks card
5. Click on Size on the Marks card and use the slider to increase the size of the marks
6. Create a quick filter on Region
7. Drag Region to the Filters shelf and check Central and East as the selected values.
 Right-click Region on the filter shelf, and then choose Show Filter”
8. Add a Quick Filter for Year.
 Right-click on Order Date in the Data Window, and then select Show Filter.
 In the Year (Order Date) Quick Filter, select the menu caret, and change the selection type to a Single
Value (List).
4
 Select 2010 as the Year.
9. Add a Quick Filter for Profit
 From the marks card, right-click on Profit and select Show Filter
 Set the bottom of the range to (-$20,000) and the top end to $20,000.
10. Add formatting:
 Name the worksheet “Filters” by double-clicking on the worksheet tab and editing the name.
 Add a Caption and Title. Access both of these options from the Worksheet menu.
 Choose Worksheet>ToolTip and edit the tooltip:

11. Save these changes to your workbook.


 Save the Workbook as “Working with Data.”
Solution available as “Working with Data”

Activity – Sorting
Objective
To apply sorts on data and show how different types of sorting options will affect the outcome of views.
Directions
 Continue with the workbook “3 Working with Data”
 Insert a new worksheet and create the following view:
o Department then Category to Rows
o Sales to Columns
 Create a manual Default Sort for Department in this order: Technology, Office Supplies, Furniture
 Apply a local sort in the view to order Category by Sum(Sales) in descending order
 Rename the worksheet “Sorting by Sales.” Add in a caption and title.

 Create a duplicate of the worksheet


 Color encode the bars in this view by Profit, and then edit the sort applied to Category to sort by Profit in
descending order.

5
 Edit the worksheet title to be “Sorting by Profit” and show the caption.

 Save changes to the workbook.

Detailed Steps
1. Continue with the workbook “Working with Data”
2. Insert a new worksheet and create the following view:
o From the Data Window drag Sales to the Columns shelf.
o Drag Department to the Rows shelf, and then drag Category to the right of Department.
3. Create a manual Default Sort for Department
o Right-click on Department in the Data Window, and choosing Default Properties>Sort
o Select Sort By>Manual and drag and drop the values to appear in the order Technology, Office
Supplies, then Furniture.
4. Sort Category by Sum(Sales) in descending order.
o Hover your mouse over the Sales axis and find the Sort button to the right of the title.
o Click on the Sort button to make the bars appear in descending order.
5. Rename the worksheet “Sorting by Sales.” Add in a caption and title from the Worksheet menu
6. Create a duplicate of the worksheet by right-clicking on the worksheet tab.
o Color encode and sort this view by Profit by dragging Profit to color in the Marks card
7. Right-click Category on the Rows shelf and choose “Sort” to edit the sort applied to Category
8. Leave Sort order as descending, and change the Field selection to be based on sum of Profit.
9. Edit the worksheet title to be “Sorting by Profit” and show the caption.
10. Save changes to the workbook.
Solution available as “Working with Data – Sorting”

Activity – Creating Groups and Hierarchies


Objective: To create a logical Group from dimension members that can be used in a Hierarchy and
demonstrate the organizational value of those two concepts together.
Directions
Continue with the workbook “Working with Data”

6
 Insert a new worksheet and create the following view:
 Category to Rows
 Sales to Columns
 Sort by Sales in descending order
 Select labels from Category to create a Group which includes the following members: Envelopes, Pens &
Art Supplies, Scissors, Rulers and Trimmers, Labels, Rubber Bands
 Rename the label for the new member “Desk Supplies”
 Create a Product hierarchy with the following dimensions in this order: Department, Category (group),
Category, Item
 Drill into Category (group) one level to display Category in the view.
 Edit the worksheet title to be “Category Grouping in a Hierarchy” and show the caption.
 Save changes to the workbook.

Detailed Steps
1. Continue with the workbook “Working with Data”
2. Insert a new worksheet and create the following view:
 Drag Sales to the Columns shelf
 Drag Category to the Rows shelf
 Sort by Sales in descending order by clicking on the Sort button on the Sales axis.
3. Create a Group from Category:
 Using control-click, select the labels for the following Categories: Envelopes, Pens & Art Supplies,
Scissors, Rulers and Trimmers, Labels, and Rubber Bands
 Once all labels are selected, click on the paper clip icon either from the tool tip, or from the toolbar,
to group the items into a new dimension named “Category (group)”.
 Note that the original Category was replaced on the Rows shelf by the new Category (group)
dimension. Also note the addition of the dimension titled “Category (group)” in the Data Window.
4. In the view, rename the label for the new member:
 Right-click on the label and select “Edit Alias…”
 In the dialog box, change the label to be “Desk Supplies”
5. Create a Product hierarchy
 In the data window, drag the dimension Category (group) onto the Department dimension to begin
creating the hierarchy.
 When prompted, rename the new hierarchy “Product”

7
 Continue dragging dimensions into the hierarchy until all the following dimensions are included,
in the following order: Department, Category (group), Category, Item
6. Drill into Category (group)
 From the view, hover over the label for the Category (group) values until the sign appears.
 Click on the + to drill down to the next level (Category).
 Re-sort the bars by clicking on the sort icon on the Sales axis.
7. Right-click Category (group) on the Rows shelf and choose “Sort” to edit the sort
8. Leave Sort order as descending, and change the Field selection to be based on sum of Sales

9. Edit the worksheet title to be “Category Grouping in a Hierarchy” and show the caption from the
Worksheet menu
10. Save changes to the workbook
Solution available as “Working with Data – Grouping”

Activity – Creating Visual Groupings


Objective
To create a Group using Visual Grouping of marks and explain how the resulting behavior differs from
Grouping dimension members.
Directions
Create a new view with Category as Rows, Sales as Columns, and sorted by Sales (descending)
 Create a visual group named “Desk Supplies” from the following Categories: Envelopes, Pens & Art
Supplies, Scissors, Rulers and Trimmers, Labels, and Rubber Bands
 Create another visual group named “Machines” with Office Machines, Copiers and Fax and Computer
Peripherals
 All others should be grouped as “Others”
 Save the workbook

8
Detailed Steps
1. Add a new worksheet to the workbook “Working with Data” and create the following view:
 Drag Category to the Rows shelf
 Drag Sales to the Columns shelf
 Sort by Sales in descending order by clicking on the sort button on the Sales axis.
2. Create a Visual Group from Category
 Select the marks for the following Categories: Envelopes, Pens & Art Supplies, Scissors, Rulers and
Trimmers, Labels, and Rubber Bands
 Create the new Group from the selection by selecting the paper clip icon. Note that members are
segmented by color.
 Next select Office Machines, Copiers and Fax and Computer Peripherals, and group those
members together.
3. Edit the Group that was created in the data window:
 Change the name to “Category Group with Others”
 From the legend, edit the aliases of the Group Members to be Desk Supplies and Machines and
color them
4. Include the view to include the Category Group with Others as the first dimension on the Rows shelf.
5. Sort Category Group with Others by Sales in descending order
6. Edit the worksheet title to be “Visual Grouping”
7. Show the Caption.
8. Save changes to the workbook.
Solution available as “Working with Data – Visual Grouping”

Activity – Creating and using Sets


Objective
To create and apply Sets in order to test intersecting dimension members and show how Scatter Plots can be
used to show a correlation of data points.
Directions
Create an Extract of the data
 Create a set for the top 50 Items by Sales
 Create a set for the bottom 50 Items by Profit
 Create a scatter plot with Sales, Profit and Items
 Use combined sets to highlight the Items that are among the highest sold and the lowest in profits.

9
Detailed Steps
To Create a Set for Top Selling Products
1. In the workbook “Working with Data” create an extract from the data connection for TRAINING
Superstore Sales. (Note: Required because In/Out sets are not possible when connected directly to an Excel
source.)
 Right-click on the data connection at the top of the data window and choose duplicate
 Rename the copy to My Superstore (Extract)
 Rick-click again and choose Extract Data -> Extract
2. Add a new worksheet to the workbook and create the following view:
 Sales to the Columns shelf
 Item to the Rows shelf
 Sort Item in descending order by Sales
3. Create a Set called Top Selling Products:
 Highlight Item in the data window, right-click and select “Create Set”
 Ensure “Use All” is selected on the General tab
 On the Top tab, create the set for the Top 50 Items by Sum of Sales
4. Filter the view with the Top Selling Products by dragging the set to the Filter shelf.
5. Edit the worksheet name to be “Top Selling Products”
6. Show the caption.
7. Save changes to the workbook.
Solution available as “Working with Data – Top Selling Products”

To Create a Set for Least Profitable Products


1. Add a new worksheet to the workbook and create the following view:
 Profit to the Columns shelf
 Item to the Rows shelf
 Sort Item in ascending order by Profit
2. Create a set called Least Profitable Products:
 Highlight Item in the data window, right-click and select “Create Set”
 Ensure “Use All” is selected on the General tab
 On the Top tab, create the set for the Bottom 50 Items by Sum of Profit
3. Filter the view with the Least Profitable Items by dragging the set to the Filter shelf.
4. Edit the worksheet name to be “Least Profitable Products”
5. Show the caption.
6. Save changes to the workbook.
Solution available as “Working with Data – Top and Bottom Selling Products”

To Create a Combined Set – High Sales and Low Profit


1. Add a new worksheet to the workbook and create a Scatter Plot to show the correlation of Sales and
Profitability:
 Add Sales to the Columns shelf
 Add Profit to the Rows shelf
 Add Item to Detail on the Marks card
2. Create a combined set called “High Sales and Low Profits” made up of the intersection between the Items
that are in both Top Selling Products and the Least Profitable Products sets.
 Click on the Top 50 set, then control-click and select the Bottom 50 set
 Once both are selected, right-click and choose “Create Combined Set.”
 Name the set “High Sales and Low Profits” and select the option for the Shared Members in Both Sets
and click OK.

10
3. Drag the set for High Sales and Low Profits to Color on the Marks card, and then drag it again to Size to
visually indicate where the intersection occurs. Then complete formatting:
 To edit color selection or size definition, choose “Edit” from the drop-down caret of the legend menu,
and make the marks that are IN the set the large, blue circle.
 Manually select the points that are IN the set, and add a Mark Annotation to view the name of the Item.
(Drag and drop overlapping labels.)
4. Edit the worksheet title to be titled “Sales and Profitability” and show the caption.
5. Save changes to the workbook.
Solution available as “Working with Data – Sales and Profitability”

Working with Special Fields


Activity – Working with Date Dimensions
Objective
To display trend analysis using dates, both discrete and continuous while being able to explain how each
changes their behavior in a view. Create and display different options for Custom Dates.
Directions
 Create a view with Order Date as Columns and Sales as Rows
 Drill into Discrete Year to the Month level, and save the view as Discrete Dates
 Insert another worksheet, and recreate the view as Continuous Month
 Create a Custom Date with Discrete Quarters, and view it in a separate worksheet
 Also create a Custom Date for Continuous Quarters, and view that in another worksheet

Detailed Steps
1. Create a new workbook and connect to the My Superstore saved data source.
2. Create a view for Discrete Dates:
 Drag Sales to Rows
 Order Date to Columns
 Drill down from Year to Quarter, then to the Month level of detail. (Note that Tableau nests every new
level in the hierarchy as a discrete dimension.)
 Rename the worksheet “Discrete Dates”
 Add in a Caption
 Save the workbook as “Dates”

11
3. Continue to create a view with Continuous Dates:
 Duplicate the Discrete Dates worksheet
 In the new worksheet, bring the hierarchy back to the Year level of detail by clicking on the “-“ sign on
Order Date
 Right-click on the Order Date field and choose the Continuous Year option as shown below

Note: the field for Year(Order Date) is now green, indicating it is continuous
 Note also that the axis has been converted to a continuous axis
 While it is possible to simply change from discrete to continuous in the right-click menu, that method
won’t enable drill options needed below.
o Click on the “+” sign on the Order Date field to drill to the Year > Quarter > Month level of
detail
 Note the differences between a discrete and a continuous drill: Tableau replaces the
previous continuous date part with the new one, and there is no option to drill back up
to higher levels (“-”).
o To add monthly tick marks: right-click on the Month of Order Date axis and choose Edit Axis,
then navigate to the Tick Marks tab. Add tick marks every 1 month.
o To rotate the axis labels up: right-click on a month label, and choose Format, then in the Format
menu on the left, set the Axis > Scale > Alignment setting to Up.
o Rename the worksheet Continuous Dates
4. Save changes to the workbook.

5. Create a new view with Continuous Custom Dates:


 Duplicate the Continuous Dates worksheet
 Right-click on the Order Date field in the Data Window and choose “Create Custom Date”

12
 Under the “Detail” drop down, select Quarters, make sure Date Value is selected, and name it Order
Date (Continuous Quarters), hit OK

 Drag the newly created Order Date (Continuous Quarters) to the Columns on top of the Month field to
replace it entirely
 Note that this behaves as a continuous date with the date truncated to the quarter level, and that the
hierarchy drill down behavior is not available
 Name the worksheet Continuous Custom Date

6. Create another view for Discrete Custom Dates:


 Duplicate your worksheet
 Right-click on the Order Date field in the Data Window, again choose “Create Custom Date”
 Under the “Detail” drop down, select Quarters but change it to be Date Part
 Name this field Discrete Quarters
 Remove the date field on the Columns shelf, and then drag Discrete Quarters to Columns
Note this behaves as a discrete dimension truncated to the quarter level, and also that the hierarchy
drill down behavior is not available.
7. Add Formatting:
 In the Marks card, change the mark type to Bar
 Name the worksheet Discrete Custom Date.
8. Save changes to the workbook.

13
Solution available as “Working with Special Fields – Dates”

14

You might also like