Tableau Exercise Sheet Part 2


Facebooktwittergoogle_pluspinterestlinkedinmailFacebooktwittergoogle_pluspinterestlinkedinmail

Tableau Exercises P2

The following exercises are used to help you discover the various features of Tableau and designed to get you up and running as fast as possible. These exercises are all built using the Tableau Sample Data Source.

Exercise 1: Using Calculated Fields

In addition to your Data Source Items  you can also create your own custom Calculated Fields.

  • Create a new Workbook, Connect to Tableau Server and access the EU Superstore Data Source.
  • In either the Dimensions or Measures pane click on a blank space and select Create Calculated Field.
  • Calls this Calculated Field 20% of Sales.
  • In the main area start type the following [Sales] * 0.2
    • You might notice that when you start typing Tableau will try to auto-complete with available items in your Data Sources as well as other Calculated Fields and Functions.
  • On the Bottom Left you should see The calculation is valid. Tableau will try to valid all calculated fields and will give you an error message.
    • Add a letter after 0.2 and see what Tableau says.
  • Click ok Save the Calculated Field.
  • You can now use this Calculated Field in the same way as any other Measure.
  • The Right Arrow in the Calculated Field box gives you a list of all available Functions.

NOTE: You can create a wide range of Calculation for various purposes but before creating complex calculations make sure you look at the list of functions available out of the box. Also be sure to check out the list of functions that have been contributed by the Tableau Community: HERE

Exercise 2: Quick Table Calculation

As well as creating and using items from your Data Source you can also make use of Tableau Calculations that performance calculations based on the items on the items on the canvas. For example if you wanted to create a calculation that measures the growth of a value over time the calculation could be a bit tricky but by using Tableau Table Calculations this can be done quickly and simply.

  • Create a new Workbook, Connect to Tableau Server and access the EU Superstore Data Source.
  • Put Order Date into the Columns
  • Set this to Continuous and by Months
  • Double Click Sales to bring this into our visualisation.
  • Click on Show Me and select a Line Graph.
  • Keep your finger on Control and click and drag SUM(Sales) in the Rows slightly to the Right to create a copy.
    • Copying items saves so much time.
  • Right Click on the copy of SUM(Sales) and go down to Quick Table Calculations and select Running Total.

NOTE: You have a lot of options for Table Calculations i.e. calculate across or calculated down. The best thing to do is explore the Quick Tableau Calculations and then when you get comfortable start searching Google. Quick Tableau Calculations are very quick and easy to use but you could also go about defining your own Table Calculations.

Exercise 3: Quick Filters Multiple Sheets

A Workbook can consist of many different Worksheets. If you want a filter that has been applied to one worksheet to be applied to all Worksheets you can do this by performing the following:

  • Create a New Worksheet and access EU Superstore.
  • Create a Two Worksheets with the EU Superstore. Time to get creative.
  • Add some items into the Filters Panel.
  • Right Click on the pill in the Filters Panel and go down to Apply to Worksheets.
  • Explore the three options available:
    • Apply to All Using This Data Source
    • Selected Sheets
    • Only This Worksheet (by Default)

NOTE: This is especially useful when putting several Worksheets together on a Dashboard and allowing a single Quick Filter to be applied to all visible Worksheets.

Exercise 4: Using Parameters

Parameters are essentially Workbook variables that can be compared against and used in your Calculated Fields. A common use of Parameters is to create Cross Data source Filters.

  • Create a New Worksheet and access EU Superstore.
  • Right click in the Dimension pane and select Create Parameter.
  • Name this as Start Date and choose the Data Type as Date.
    • Set the default value as 01/01/2013
  • Click OK.
  • Create an additional Parameter called End Date with the Date.
    • Set the default value as 01/01/2014
  • Click OK
  • Create a Calculated Field called Date Filter with the following formula:
    • [Start Date] < [Order Date] AND [Order Date] < [End Date]
  • Drag Date Filter into the Filters Pane and select True.

NOTE: Parameters are a static at the moment do you not have the ability to be dynamically populated by a field.

Exercise 5: Dashboards

After you create several different Worksheets you may want to combine them all into a single view; this is where Tableau Dashboards come in.

  • Create a new Workbook.
  • Create two Worksheets.
  • In the Menu click on Dashboards → New Dashboard.
  • Drag the Horizontal Containers in the Canvas.
    • This gives you the layout for your Dashboards.
    • You can put Horizontal and Vertical containers within each other.
  • Drag the Worksheets into this Horizontal Containers.
  • Select the Worksheet and click Normal and change this to Fit Width.

 

  • Setting this will help you create the required look and feel.

NOTE: Creating good looking Dashboards is an art form. The main thing is to look at to what others are doing and trying to copy them. Internally we have a Showcase Tableau Site but you can also check out the Tableau Public archives.

  • Right Click on the Worksheet Down Caret and Explore the possible options.
  • However, I want you to go down to Quick Filters and select a quick filter to add to your Dashboard.
    • You can also do this with Parameters, Legends and other elements.

Exercise 6: Dashboard Actions

Once you have created a Dashboard with multiple Worksheets you may want the Worksheets to interact with each other. These interactions are called Dashboard Actions.

  • Create a New Workbook which accesses EU Superstore
  • Create three Worksheets and ensure that you have Country in all three.
    • Worksheet 1: A High Level Summary Worksheet.
    • Worksheet 2: A Mid Level Dashboard
    • Worksheet 3: A Low Level Dashboard
  • Create a New Dashboard.
  • In the Dashboard Drag a Vertical Container into the Dashboard.
  • Drag Worksheet 1 into the Vertical Container.
  • Drag a Horizontal Container to the bottom of the Vertical Container.
  • Drag Worksheet 2 and 3 into the Horizontal Container.
  • Your Dashboard should look like the following:

 

 

  • Now go to Menu → Dashboard → Actions.
  • Click on Add ActionFilters.
  • Set the following:
    • Name: Country Action Filter.
    • Run action on: Select
    • Source Sheets: Worksheet 1
    • Target Sheets: Worksheet 2 and 3
    • Clearing the Selection will: Show all Values
  • Click Ok.

NOTE: Now exploring what this has done, when you click on an item in Worksheet 1 you should filter Worksheet 2 and 3. You can now create very Dynamic Dashboards.

Exercise 7: Data Blending

You may have to build a Worksheet that combines multiple Data Sources; sometimes there data sources are from completely different systems but you can connect them with a common key. This process is called Data Blending.

  • Create a New Workbooks
  • Access Two Data Sources EU Superstore, World Indicators
  • We will now need to check the relationship that Tableau believes exists between these two Data Sources. On the Menu click on Data Edit Relationships.
  • You will see that the Data Sources are connected using Country and Region. You may have to set this up yourself when connecting Data Sources. Click Ok or Cancel (since we didn’t changed anything).
  • From the EU Superstore Double Click Country and Sales.
    • Yes, Tableau tries to be smart and since we have select Country Tableau displays a Map.
  • From the World Indicators Data Source double click Business Tax Rate.
  • You have now created a visualisations with Data from two Data Sources.

NOTE: The primary Data Source is Blue and the Secondary Data Source is Orange. Always make sure the Primary Data Source is the most detailed. There is also a link icon which turns Orange, make sure this is ticked. Please be aware that with very large data sets Data Blending does become a performance issue.

 

Facebooktwittergoogle_pluspinterestlinkedinmailFacebooktwittergoogle_pluspinterestlinkedinmail

Toan Hoang

About Toan Hoang

Toan Hoang is a technology enthusiast with a broad understanding and appreciation of most aspects of technology but with a passion for Business Intelligence Solutions and Technologies, Data Management and Web Programming.

Leave a comment

Your email address will not be published. Required fields are marked *