0% found this document useful (0 votes)
129 views21 pages

2 - Connecting To The Data

Uploaded by

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

2 - Connecting To The Data

Uploaded by

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

Chapter 2|Connecting to the Data - Exercises

Exercises - Connecting to the Data


Tableau allows you to directly connect to the databases, cubes, and data warehouses. The data access is
very easy without any advanced setup, and the data is updated automatically. One can pick tables from
spreadsheets to data from Hadoop to create a perfect mash-up and get desired results in no time.

Business Scenario
A Cosmetic Industry has recently acquired the Tableau software to strengthen its analysis and reporting
capability, by analyzing millions of rows of client data for marketing. Being a data manager, you are
asked to blend the data from multiple data sources using Tableau. To get started, you first need to
connect to a data source.

Exercise 2.1: Connect to a Data Source

Overview
In this exercise you will:

 Connect live to an Excel sheet data source.


 Use the Sample – Superstore Subset (Excel) sample data source to analyze the sales for each
state.
 Add State or Province Dimension and Sales Measure to create the view in such a way that, the
states on the map have mark size corresponding to their sales value.

© 2014, Nice Educons 1


Chapter 2|Connecting to the Data - Exercises

The final result should resemble the following image:

Detailed Instructions

Open Tableau

1. On the Start menu, point to All Programs, and select Tableau.

Connect to Data Source

2. On the home page, under Data, click Connect to data.

© 2014, Nice Educons 2


Chapter 2|Connecting to the Data - Exercises

OR
On the Data menu, select Connect to data.

3. On the Connect page, under In a file, select Microsoft Excel.

4. In the Open window, navigate to the Documents\My Tableau Repository folder and double-
click Datasources.
5. Select Sample - Superstore Subset (Excel).xlsx file.

© 2014, Nice Educons 3


Chapter 2|Connecting to the Data - Exercises

6. Click Open.

© 2014, Nice Educons 4


Chapter 2|Connecting to the Data - Exercises

7. In the Tableau - Book window, Under sheets in the left pane, drag the Orders table to the Drag
sheets here pane as shown in the image below:

8. Click Go to Worksheet.
Note: Below Connection make sure Live radio button is selected.

© 2014, Nice Educons 5


Chapter 2|Connecting to the Data - Exercises

The worksheet should resemble the following image:

Create View

9. In the Data pane, under Dimensions, double-click State or Province.


10. In the Data pane, under Measures, drag Sales to the Size in the Marks card.
11. In the Data pane, under Dimensions drag State or Province to the Label in the Marks card.

© 2014, Nice Educons 6


Chapter 2|Connecting to the Data - Exercises

The final result should resemble the following image:

12. On the File menu, select Save.


13. In the Save As window browse to the Documents\My Tableau Repository\Workbooks folder
and save workbook as State Sales Value Map.

© 2014, Nice Educons 7


Chapter 2|Connecting to the Data - Exercises

Exercise 2.2: Multiple Tables


Overview
In this exercise you will:

 Connect to multiple tables.


 Connect to the Orders table and then join the Users table via inner join.
 Create a line view to display region-wide sales data.

Use the Orders and Users sheet in the Sample- Superstore Subset (Excel) excel file.

The final result should resemble the following image:

Detailed Instructions
1. Open the State Sales Value Map workbook.

© 2014, Nice Educons 8


Chapter 2|Connecting to the Data - Exercises

2. On the Data menu, point to Orders(Sample - Superstore Subset (Excel)) and click Edit Data
Source as shown below:

3. Drag Users table in the Drag sheets here pane to create a join between two tables. It will display
data for both the tables:

© 2014, Nice Educons 9


Chapter 2|Connecting to the Data - Exercises

4. Click Go to Worksheet.
5. In the Columns shelf, click the Longitude (generated) drop down list, and select Remove.

6. In the Rows shelf, click the Latitude (generated) drop down list and select Remove.
7. In the Marks card, click the State and Province drop down list and select Remove.
Note: There are two State and Province on Marks card, remove both.
8. In the Marks card, click the SUM (Sales) drop down list and select Remove.

Your worksheet should resemble the following image:

Create View
9. In the Data pane, under Dimensions, locate and drag Region (Users) to the Columns shelf.
10. In the Data pane, under Measures, locate and drag Sales to the Rows shelf.
11. To change the graph type, in the Marks card, click the drop-down and select Line.

© 2014, Nice Educons 10


Chapter 2|Connecting to the Data - Exercises

The final result should resemble the following image:

12. On the File menu, select Save As.


13. In the Save As window browse to the Documents\My Tableau Repository\Workbooks and save
workbook as Region Sales View.

© 2014, Nice Educons 11


Chapter 2|Connecting to the Data - Exercises

Exercise 2.3: Data Blending


Overview
In this exercise you will:

 Blend the data from two data sources by connecting to both the data sources at a time.
 Add Profit and Department data from Sample-Superstore-English (Extract) data source.
 Add Gross Profit Ratio data from Sample-Superstore Subset (Excel) data source.
 Analyze the Profit and Gross profit ratio for each department.

The final result should resemble the following image:

Detailed Instructions

Connect to Data Source

1. On the Home page, under Saved Data Sources, click Sample-Superstore-English (Extract) data
source.
Note: Open a new workbook, do not use previous exercise workbook.

Create View

2. In the Data pane, under Dimensions, locate and expand Product Dimension and drag
Department to the Rows shelf.
3. In the Data pane, under Measures, locate and drag Profit to the Columns shelf.

© 2014, Nice Educons 12


Chapter 2|Connecting to the Data - Exercises

Connect to Data Source

4. On the upper right corner of the workbook, click the Home page tab as shown below:

5. On the Home page, under Saved data sources, click Sample-Superstore Subset (Excel) data
source.
6. In the Data pane, under Measures, locate and drag Gross Profit Ratio to the Columns shelf.

Note: Observe the orange check marked data source symbol that appears next to Gross Profit
Ratio field in the Columns shelf. This indicates that the field is coming from a secondary data
source.

The final result should resemble the following image:

7. On the File menu, select Save.


8. In the Save As window browse to the Documents\My Tableau Repository\Workbooks and save
workbook as Data Blending-Example.

© 2014, Nice Educons 13


Chapter 2|Connecting to the Data - Exercises

Exercise 2.4: Copy the data from an excel sheet and paste it in the
Tableau workbook
Overview
In this exercise you will:

 Copy the data from an excel sheet and then directly paste it in the Tableau’s workbook.
 Use the Orders sheet in the Sample- Superstore Subset (Excel) excel sheet to get the data
for the first 25 products and their corresponding base margin values.
 Create a horizontal bar graph view for the data in Tableau.

The final result should resemble the following image:

Detailed Instructions
1. On your Desktop, browse to the Documents\My Tableau Repository folder and double-click
Datasources.
2. Double-click Sample- Superstore Subset Excel.xlsx excel sheet.

© 2014, Nice Educons 14


Chapter 2|Connecting to the Data - Exercises

3. In the excel sheet, select the first 25 rows of Product Name and Product Base Margin Columns
data as shown below:

4. Right-click the selected data and select Copy.


5. Open Tableau 8.2.
6. On the Data menu, select Paste Data.

© 2014, Nice Educons 15


Chapter 2|Connecting to the Data - Exercises

The view should resemble the following image:

7. In the Data pane, under Measures, locate and drag Product Base Margin to the Columns shelf.

© 2014, Nice Educons 16


Chapter 2|Connecting to the Data - Exercises

The final result should resemble the following image:

© 2014, Nice Educons 17


Chapter 2|Connecting to the Data - Exercises

Exercise 2.5: Data Extract


Overview
In this exercise you will:

 Create an extract to display the top five product sales data.


 Use the Sample-Coffee Chain (Access) data source to create a view that displays product sales
for each year.
 Create an extract for the top five products and refresh the data.

The final view should resemble the following image:

Detailed Instructions

Create View

1. On the Home page, under Saved data sources, click Sample-Coffee Chain (Access).
2. In the Data pane, under Dimensions, locate and drag Date to the Columns shelf.
3. In the Data pane, under Dimensions, locate and drag Product to the Rows shelf.
4. In the Data pane, under Measures, locate and drag Sales to the Text in the Marks card.

© 2014, Nice Educons 18


Chapter 2|Connecting to the Data - Exercises

The sheet should resemble the following image:

Create Extract

5. On the Data menu, point to Sample-Coffee Chain (Access), and select Extract Data.

6. In the Extract Data window, under Number of Rows, select Top.


7. In the Top text box, type 5.

© 2014, Nice Educons 19


Chapter 2|Connecting to the Data - Exercises

8. Click Extract.

Save Extract

9. In the Save As window browse to the Documents\My Tableau Repository\Datasources and


save the extract as My Coffee Chain Extract.

The final view should resemble the following image:

© 2014, Nice Educons 20


Chapter 2|Connecting to the Data - Exercises

Refresh Extract

10. On the Data menu, point to Sample-Coffee Chain (Access), and select Refresh.
11. On the File menu, select Save.
12. In the Save As window browse to the Documents\My Tableau Repository\Workbooks and save
workbook as Data Extract-Example.

© 2014, Nice Educons 21

You might also like