Course Slides - Tableau Fundamentals
Course Slides - Tableau Fundamentals
Corporate
BIDA TM - Business
Finance Intelligence
Institute® & Data Analysis
The World of Business Intelligence
Tableau fits into the later stages of the BI process, used by analysts and viz specialists to create visuals dashboards.
Excel
SQL Power Pivot for Excel
BI Power Query
Tools Power BI
Tableau Prep Tableau
Python
Data Architect
Data Engineer / SQL Developer
BI
Database Admin (DBA) Data Visualization Specialist
Roles
Business Intelligence Developer or Generalist
Data Analyst
1 Go to public.tableau.com
2 Press sign up
Corporate
BIDA TM - Business
Finance Intelligence
Institute® & Data Analysis
Importing Data – Learning Objectives
Tasks
Skills
Identify Identify and Use the Identify data Apply common Perform
Fact vs load CSV and Data types transformations table Joins
Dimension Excel files Interpreter and Unions
tables
5 Press Open
4 The left pane now shows the Excel file connection, with a list of all the available sheets of information below it.
1 From the SalesData connection, drag the FactOrders table from the data pane into the canvas at the top.
4 Click on the FactOrders sheet and look at the data Tableau has identified as headers, and data
5 Use the Key for Data Interpreter tab to familiarize yourself with the key
6 Back in Tableau, click on the new data range called FactOrders A1:B3 to see what data Tableau has removed
3 Drag the sales measure into the big white area on the right, creating a simple table
4 Now we can go to the file menu and save this workbook to our Tableau Public Profile that we created earlier.
2 Familiarize yourself with the file options, including download, trash, favourite
3 Also, notice the visibility icon in the top right, allowing you to hide reports from public view
4 Open Tableau Public Desktop and familiarize yourself with the opening menu
5 Files can be opened from the recent items list or by click Open from Tableau Public
6 I recommend directly opening from Tableau Public as this method seems to be more reliable
To explore the data view, you’ll need to connect the file to the relevant data sources.
If you are opening Tableau Public files provided with this course, you’ll need to do the following
2 On the first pop up, browse to the SalesData.xlsx file and click open
3 On the second pop up, browse to the Dimension Tables.xlsx file and click open
2 Press split
3 Notice the three new columns that Tableau created, automatically detecting the desired result
1 Undo the last action using the undo arrow at the top left of Tableau
2 Click on the drop down on the OrderID column header and select Custom split
4 Then define explicitly that you want to return the First, 1 column only
Numerical Values
Date Values
2 Click the drop down on the column header and press Aliases
3 Double click each alias to give it a more meaningful name, for example Canada and United States
1 Hide the RowID column using the drop down on the column header
2 Notice the option in the top right of the data pane allowing you to re-show hidden fields
Joins allow us to physically combine two different tables into one, by matching column values.
Joins allow us to physically combine two different tables into one by matching column values.
Right Join
Full Outer Join
Returns all records from the
Returns all records from
right table, but only the
BOTH tables, matching rows
matched rows from the left
where possible.
table.
*Note that when duplicate values appear in either table, multiple rows will be returned. This isn’t usually a problem with One-To-
Many relationships since one side of the relationship only contains unique values.
*Note that when duplicate values appear in either table, multiple rows will be returned. This isn’t usually a problem with One-To-
Many relationships since one side of the relationship only contains unique values.
*Note that when duplicate values appear in either table, multiple rows will be returned. This isn’t usually a problem with One-To-
Many relationships since one side of the relationship only contains unique values.
*Note that when duplicate values appear in either table, multiple rows will be returned. This isn’t usually a problem with One-To-
Many relationships since one side of the relationship only contains unique values.
2 Select the Dimension Tables excel file from the Tableau Course Files folder
The fact table still appears in our data area as that’s the only data we’ve dragged into our dataset, but notice that we now have our
3
four dimension tables to play with.
1 Double click on the FactOrders table that appears on the data canvas
2 You should now see a solid box around the canvas, indicating that you are about to modify the physical structure of the table
Drag each dimension table into the box and inspect the join criteria that Tableau specifies. You should be using an inner join on the
3
ID columns
Our physical table is now made up of 5 source tables, so it makes sense to rename it. Double click on the FactOrders name and
5
rename it to SalesData
1 Make sure you can see the data in yoru data view by defining the number of rows you want to see.
2 Hide the duplicate Join KEY or ID columns from the dimension tables, leaving us only with the new information.
A union combines 2 or more tables by adding the rows from one table to another.
1 261.24 CG-12520
OrderID Revenue CustomerID
2 14.62 DV-13045
1 261.24 CG-12520
2 14.62 DV-13045
3 957.57 SO-20335
OrderID Revenue CustomerID
4 1706.18 BH-11710
3 957.57 SO-20335
4 1706.18 BH-11710
1 In the data source view, hover over the FactOrders table in the connection pane
2 Use the inspect icon on the right to inspect the columns in the dataset
4 Click the order date column header to sort and ensure the tables contain the data you expect
1 Double click on the SalesData in the canvas to reveal the 5 JOINED tables
2 Click on the drop down on Fact Orders, and click Convert to Union
3 Drag the FactOrders18-19 table from the connections pane onto the Union area
4 In the data grid, scroll right to see the two new columns: Sheet and Table Name
Use the visible rows indicator in the top right, as well as the sort order of the OrderDate column to check that we have data from
6
2014 through to 2019, meaning that our UNION has been successful
1 In the data source view, look for the word Filters in the top right and click Add.
3 For wildcards, contiions, and top N filters, use the other tabs.
Import and manipulate the Airbnb data to create a new dataset about Airbnb properties in New York.
Steps
1 Open Tableau Public Desktop and create a Text connection to the Airbnb.csv file
2 Create a LEFT JOIN between the main table, and the location dimension table
3 Hide the new ZipCode column from the newly added location table columns
4 Split the Property column into two separate columns and remove the original column
Please attempt this exercise yourself before following the detailed steps answers page
Detailed Steps
1 Open Tableau Public Desktop, Navigate to the End of Chapter Exercises and create a Text connection to the Airbnb.csv file
2 Drag the Airbnb.csv table to the data canvas.
3 Double click on the Airbnb.csv table that appears on the data canvas
4 You should now see a solid box around the canvas, indicating that you are about to modify the physical structure of the table
Drag the LocationAirbnb.csv dimension table into the box and inspect the join criteria that Tableau specifies. You should be using a
5
left join on the postal code column.
Locate and split the column Property. Click on the dropdown menu on the top right and select custom split. For separator enter “-”
6
and select Split off all.
7 Hide the column Property by selecting Hide from the drop-down menu
8 Rename Property - Split 1 to Room Type and Property - Split 2 to Beds
9 Hide the column Zipcode (LocationAirbnb.csv) by selecting Hide from the drop-down menu
10 Make sure you saved your work.
Corporate
BIDA TM - Business
Finance Intelligence
Institute® & Data Analysis
Mastering Calculations - Learning Objectives
Tasks
Skills
Use text, date Manipulate Work with Test conditions Combine Use Table
& number aggregation and discrete and with logical multiple Calculations to
functions granularity continuous functions conditions supercharge
dates with AND and your metrics
OR
3 Now drag the sales from their current place, into the Columns Shelf
6 Make sure you can see the legend on the right hand side
Calculated fields are used to create new columns from the data that already exists in your data source.
Example uses:
Calculated fields are permanent additions to your data table and can be referenced in visuals.
1 In Sheet 1, at the top right of the Data pane, click on the drop down and select Create Calculated Field
2 In the calculation editor, give the new measure a name of Profit Ratio
5 Click on the arrow on the right-hand side to explore other available functions
6 Create a new sheet and add the Profit Ratio onto the canvas
7 Right click on the measure and change the formatting of Profit Ratio to a %
3 Reorder the measures so that they appear Sales, Profit, Profit Ratio
4 Look at the different aggregations that have been used in the measures area
5 Use the drop down on the Sales measure to explore the available aggregations
7 Create a new Calculated Field called Profit Ratio wo Aggregation using the formula [Profit] / [Sales]
8 Add this new measure to our table and set the formatting for the new measure to % using the measure drop down
9 In the Data Source view, notice that in every row, the two Profit Ratio calculations are the same
10 But now in Sheet 2, notice that when aggregated, the two Profit Ratio calculations are very different
2 Instead, place the OrderID on the row shelf, and when prompted click Add all Members
3 Add Product Name also the Rows Shelf and again Add All Members
4 Click on an OrderID that has multiple products, each with a positive profit ratio
6 From the Analytics Pane on the left, drag Totals into the Column Grand Totals area
Take some time to understand why at a row level from our data source, the profit ratios calculate the same result, but that in an
7
aggregated form they show different results.
Text / string functions allow us to manipulate data made of text. For example:
Returns a number of characters Returns a number of characters Returns the text with leading
from the start of the given text. from the end of the given text. and trailing spaces removed.
Text Functions
1 In the Data Source view, click on the drop down of the Postal Ref column and select Create Calculated Field
Returns the absolute Returns the result of a Returns the maximum of Returns the minimum of
value of the given number raised to the a single expression a single expression
number. given power. across all records. across all records.
Number Functions
4 Drag the OrderID into the Rows Shelf and Add All Members
5 Drag the Product Name into the Rows Shelf and Add All Members
6 Select an order that has more than one product and Keep Only that one
7 Add Sales in to the Table Area (also known as the Text Pane)
8 Create a new Calculated Field called Max Sales using the formula MAX([Sales])
9 Add Max Sales to the table and take a look at the individual Max Sales values per product row
10 Remove Product Name from the Rows Shelf and notice what happens to the MAX value when aggregated
11 The MAX function is diving into the lowest possible granularity at the source and returning the biggest value.
Discrete Continuous
• Are made up of date parts • Use date values that follow a chronological
order from left to right.
May 5th, 2020 = Month Day Year
• They cannot be sorted!
4 The sales are grouped by year, and the date pill in the row shelf is blue, indicating we are using discrete dates
5 Use the drop down on the date pill to select months, just below the selected year value
6 We now have buckets representing months, with all January sales aggregated together, regardless of year
7 Use the drop down on the date pill to select months further down
8 The we are showing a timeline, the date pill in the row shelf is green, indicating we are using continuous dates
9 Use the + - icons above the timeline to increase and decrease the level of granularity
Today
TODAY()
TODAY () = 2020-06-01
Datepart
DATEPART(‘month’, #2020-06-01#)
DATEPART (date_part, date) =6
Datetrunc
DATETRUNC(‘month’, #2020-06-22#)
DATETRUNC (date_part, date) = 2020-06-01
Datediff
DATEDIFF(‘day’, #2020-06-22#,
DATEDIFF (date_part, start_date, #2020-06-30#)
end_date) =8
Date Functions
1 Go to the data source view and right click on the order date column
2 Create a new calculated field called Days To Ship using the following formula: DATEDIFF('day',[OrderDate],[ShipDate])
5 Add Days To Ship to the text pane (the measures area of the table)
6 Right click in the Days To Ship column header, and sort descending to reveal the orders which took the longest to process
[Date] = #2020-08-01# [Profit] > 50,000 [Sales] < 10,000 [Region] != ‘East’
2 Drag state to the rows shelf and sales to the text shelf
5 Add the MoreThan10k measure to the rows shelf, after the State
6 Note that this field now correctly identifies when the aggregated sales for any given state are > 10000
AND OR NOT
5 Modify the formula to protect against mismatches between upper and lower case
9 Our condition correctly identifies the row that matches both conditions
5 Create an IF statement to define more clearly the outcomes, instead of outputting TRUE or FALSE
7 Now we have more helpful results, showing Profitable and Unprofitable instead of TRUE and FALSE
4 Click on the drop down of SUM(Sales) and goto Quick Table Calculation
6 Use your mouse to drag and lasso the data in the table, to check they add up to 100%
7 Remember, Table Calculations are calculated in the context of what’s in the table
9 Notice that the %s still total 100%, despite one category being missing. Table calculations are in the context of what is in the table.
2 From the Analytics menu add subtotals and total to the view by dragging.
3 Hold Control (Windows) or Command (Apple) and select 2018 and 2019. Press Keep Only
4 Add Sales to text shelf. Add a quick table calculation running total.
6 Edit the table calculation. Under Specific Dimensions select Quarter of OrderDate.
Steps
2 Average price.
4 Number of listings.
Please attempt this exercise yourself before following the detailed steps answers page
Detailed Steps
9 Make sure the calculation is locked by editing the table calculation and under specific dimension select Room Type.
Corporate
BIDA TM - Business
Finance Intelligence
Institute® & Data Analysis
Creating Visuals - Learning Objectives
Tasks
Skills
1 Topline summary showing high level numbers (ex. Orders, Sales…etc) 1 Map showing performance by region
5 Right click on order date at the top of the table visual and hide field labels.
6 Make each of the table rows slightly bigger by dragging the row border
2 Rename the title to Revenue by Ship Mode and Subcategory ($USD). Choose size 12
3 Add Ship Mode to columns, Sub Category to rows and Sales to text.
3 Click on the OrderDate pill dropdown and select a Continuous Month from the second list of period types. The pill should be green.
2 In the marks shelf you now have three sections, All, Sales and Profit.
4 Change the sheet name to Perf over Time LINE and title to Performance Over Time.
1 From the data pane drop down, select Create Parameter and name it Select a measure.
2 Select List under Allowable values. Enter Sales and Profit and press ok.
3 Right click on the parameter in the data pane and select show parameter.
4 Create a calculated field called Sales Profit Swap. IF [Select a Measure] = ‘Profit’ THEN [Profit] ELSE [Sales] END
5 Remove both measures currently on rows and add the measure Sales Profit Swap.
1 Duplicate the Sales Profit Swap measure and rename it to Sales Profit Selection.
2 Edit the formula to IF [Select a Measure] = ‘Profit’ THEN 'Profit’ ELSE ‘Sales’ END
3 Place the new measure on the rows shelf, BEFORE Sales Profit Swap.
4 Right click on the cell to the left of our chart and select Rotate label. Next hide field labels for rows.
5 Right click on the original axis, select edit and remove the title.
6 Edit the Sales Profit Selection measure and add the the currency ($USD) to each of the outcomes.
1 Create a new parameter called Highlight Category and select string for the data type
2 Select list from Allowable values and select the When workbook open radio button. From the list Choose Category. Press OK.
5 Place the measure on the color shelf. Note that this replaces the Category attribute on this shelf.
7 Change the color. Assign the hex color #ADB0B8 to False. Assign the hex color #25A2AF to True.
1 Double click on the chart title and clear the current contents.
2 Use the Insert menu to add the Swapping and Highlight Parameters. They start with the prefix Parameters.
3 The final title should be <Parameters.Select a measure> by Month (<Parameters. Highlight Category> highlighted)
4 Change everything to size 12. Leave the titles normal, but the <measure values> in bold.
2 Under borders formatting remove the row dividers from the pane.
4 Click and hold on the true series in the legend and move it above the false.
3 Click on the category pill dropdown and sort by Field Sales descending.
4 Edit the axis and untick include zero to see how different the chart looks visually.
10 Turn on labels by click on the Label Shelf and selecting Show mark labels.
3 Add a table calculation, % of total and modify the title in the tooltip to % of Total Sales.
3 In the Lines formatting options of the visuals, remove gridlines for columns.
4 The marks shelf now has three drop down sections. All, Sum(sales), and Sum(Sales)(2).
5 The first of the sales marks will be our bars, and the second of the sales marks will be our circles.
6 Change the first sales measure to a bar. Change the second measure to circle.
8 Reduce the bar width using the size mark from the first sales measure.
9 Increase the circle size using the size mark from the second sales measure.
1 Create a new parameter. The Data Type should be Integer and the current value 10.
4 Select By Field and select the top n states parameter from the dropdown menu.
2 The final title should be Top <Parameters.Top N States> States by Sales ($USD)
6 Change the color of the bar to #ADB0B8 using the first sales marks.
7 Change the color of the circles to #132E57 using the second sales marks.
9 Click on the label shelf to modify the formatting. Change the alignment to center. Change the font to White, Bold, Size 12.
10 Format the Sales measure to Number (Custom) and set the number of decimals to 0. Also set the display units to Thousands.
11 Adjust the size of rows and circles so the numbers fit in the circle and there is not overlap.
1 Add the Profitable measure that we created earlier to the color shelf
2 Modify the colour. Dark blue #132E57 for profitable and Orange #FA621C for unprofitable.
1 Modify the title to Profitable vs Unprofitable Customers. Use same color coding on the text to identify the two categories.
3 Reduce the opacity to somewhere between 50-70. Finally change the title to size 12.
5 Edit colours in the colour shelf. Negative Orange #FA621C, positive Dark Blue #132E57
2 Select 10 by Sales
2 Change the title to Top 10 Performing Products and add color coding.
3 Add a subtitle in the line below to show (Rectangle size represents sales) (Colours represent profitable and unprofitable)
4 Add colour coding to our subtitle, highlighting profitable and unprofitable in blue and orange respectively.
5 Format the Profit Ratio measure using the Formatting Pane. Change to percentage.
1 Create a new sheet called Sales MAP and Double click on State to show a map.
3 Place Region to color and Sales, Profit and Profit Ratio to tooltip.
5 Using the colour shelf, change the region colours: Mid West #132E57, North East #25A2AF, South #57595D, West #FA621C
6 Change the number format for Profit Ratio and Adjust the tooltip to include the sales units Sales ($USD), Profit ($USD).
4 Under visual formatting pane, remove the row and column divider.
2 Double click on Profit Ratio and Sales, which will also add them to the visual.
3 Create a new measure called Order Count. COUNTD(OrderID). Place to Measure values area.
4 Create a new measure called AOV. SUM(Sales) / [Order Count]. Place to Measure values area.
8 Format the Sales, Profit and AOV measures from the formatting fields to include $ prefix and “ USD” suffix. No decimal places.
9 In the text shelf, modify the values text size and colour. Size 18 #132E57 Dark Blue.
10 Center Align.
1 Create a new sheet called Country Manufacture PIE. Change the mark to Pie.
6 Hold shift to drag and duplicate the table calculation and place it to Text.
2 Change the colors: Canada Dark Blue #132E57, United States Cyan #25A2Af
1 From the data source pane add a filter on Order Date by years.
Context Filters
Dimension Filters
Measure Filters
1 Select the sheets TBL, LOL, TREE, MAP and change the tab colour to CYAN / TEAL. These belong to the Performance by State.
2 Select the sheets HEAT, LINE, BAR, SCAT, BANS, PIE and select tab colour to DARK BLUE. These belong to the Sales Dashbaord.
1 Right click on the segment pill on filter shelf and select Add to Context.
1 Go to the Segment filter and from the dropdown menu select selected worksheets
2 Select all the worksheet coloured in TEAL that belong to the Performance by State dashboard.
2 Choose Range of Dates and use the full range. Show Filter on the visual.
Part 3 Steps
Using a parameter measure pair, modify the line chart to allow a user to switch between two measures:
- Create the swapping parameter called Select Measure
- Create a swapping measure called Num Listings Avg Price Swap
- Replace Number of Listings in the line chart with this new measure
- Create a swapping measure called Selected Measure
6
- Ensure the Y axis title is dynamic, using the Selected Measure measure
- Add and make visible a Host Since Slicer to the line chart
- Apply the Host Since slicer to all visuals
- Ensure the chart title is dynamic to include both the selected neighbourhood and selected measure
- Fill entire view
Please refer to the videos titled Creating Visuals – Student Exercise Review for detailed steps.
Corporate
BIDA TM - Business
Finance Intelligence
Institute® & Data Analysis
Dashboard Design - Learning Objectives
Tasks
Skills
1 For Size select Fixed and set the width to 1300 px and the Height to 800 px
1 Set the dashboard to tiled (bottom left corner tiled should be gray)
2 Place visuals on the dashboard and find the tiled object in the layout menu.
3 Undo
4 Make sure floating is selected and place the scatterplot on the canvas and move it around.
Video – Layering
1 Select the legend and from the dropdown menu select floating order and Bring Forward.
2 Place the scatter, bar, BANS and line charts on the canvas and hide any slicers or legends
4 Title: Sales Dashboard (size 16 Dark Blue #132E57) Subtitle: Please click on visuals to learn more (size 9)
5 Place the logo from the images folder in the top right corner.
1 Click on the scatter drop down to bring back the Order Date slicer
2 Place the order date slicer in the top right corner of the dashboard
3 Use the drop down menu to bring back the Select a Measure and Highlight Category parameter selectors
BIG NUMBERS
X 20 Y110
W 1260 H130
SCATTER BAR
SLICER SLICER
LINE
X 670 Y260
W 610 H250
2 Where applicable format the BANS so the display units are in thousands, no decimal places, and with suffix USD
TOP N
LOLIPOP MAP
REGION
LEGEND
TREE
X 20 Y 530
W 1260 H 250
1 Take a vertical container and place it on the canvas to overlap the scatterplot.
4 Make sure the container is selected and from the dropdown menu select the add show/hide button.
5 To test the interaction of the button hold alt on PC or option on Mac and click on the button.
2 Add the heat map visual and make sure the background is white.
3 Tick only the Sales by Cat BAR visual in the Source Sheets pane. Run the action on select.
4 Tick all visuals expect Bar chart and the line chart.
2 The source visual should be the map, with the filter working when the visual is SELECTed
4 Notice that the filter action does not initially work as expected
5 Goto the tree map visual sheet, and promote the Action filter pill in the filter pane, to a Context filter
Steps
Please refer to the videos titled Dashboard Design – Student Exercise Review for detailed steps.
Corporate
BIDA TM - Business
Finance Intelligence
Institute® & Data Analysis
Relationships - Learning Objectives
Task
Skills
2 In the Data Source tab, create a union between FactOrders and FactOrders18-19
3 Add a second connection to the dimension tables (dimCustomer, dimLocation, dimProduct, and dimShipping)
4 Drag the dimensions onto the Canvas. A noodle will appear connecting the two tables
If working with other datasets, these settings may change. Often companies provide an ERD diagram to visualize the data
4
relationships.
1 Explore your data to ensure whether All records match or Some records match (for this dataset, All records match)
2 For this dataset, all records match, so select All records match for both sides of the relationship