Maven Advanced Tableau
Maven Advanced Tableau
Maven Advanced Tableau
This is a project-based course, for students looking for a practical, hands-on, and highly
engaging approach to learning business intelligence with Tableau Desktop
Quizzes & Homework Exercises to reinforce key concepts, with step-by-step solutions
Bonus Projects to test your abilities and apply the skills developed throughout the course
THE You’ve just been hired by Maven Roasters, a bespoke, small batch coffee roasting company.
SITUATION Your role? Use advanced analytics and visual design to take Maven’s BI reports to the
next level!
THE Maven Roasters needs a way to track KPIs (sales, profit, units, returns), compare
BRIEF performance across markets, analyze category profitability, and identify high-value
customers.
All you’ve been given is a folder of excel files containing information about orders, returns,
products, customers and territories.
2 What you see on your screen may not always match mine
• Tableau desktop updates on a monthly basis for minor releases and quarterly/yearly for major
releases, so features and functionality may change over time
• Reduce up front data prep by • Reduce the number of data • Retain measures that could be
utilizing flexible relationship sources pulled in to answer lost or distorted through joins
joins analytic questions and blends
• Relationships push the join to • Preserve all detailed records • Relationships ensure measures
the viz-level, allowing for from a relationship source with will not duplicate or
many more possible join multiple tables overstate due to join clauses
scenarios to occur from the
same source
NOTE: The Physical layer is the same data model structure as the
original data model prior to 2020.2.
• Tables dragged here are called “Logical” tables • Tables dragged here are called “Physical” tables
• Logical tables are containers for “Physical” tables • Physical tables are merged into a single flat table that defines the
logical table.
• Logical tables remain distinct, not merged in the data
source • Joins / Unions connect physical tables together via related fields
• “Noodles” connect Logical tables together via related fields
PRO TIP: To access the data model view from pre-2020.2 (i.e. joins, unions,
Venn Diagrams), simply double-click the table brought into the data
canvas
Relationships Joins
• Logical tables are displayed using “noodles” to • Physical tables are displayed using Venn Diagrams
identify relationships between tables to identify joins between tables.
• Require matching fields between logical tables • Require join clause & join type selection
• Keeps each table separate, and only performs • Joins data into one physical table with specified
joins at viz-level when needed granularity defined
• Avoids data duplication through smart • Can support row-level security and extract filters
aggregation
Relationships are not supported for data source connections including Cube Sources, Stored
Procedures, Splunk, JSON, Salesforce (single source only), and SAP HANA (with OLAP chosen)
Cardinality
Determines if tableau aggregates before or after joining data during
analysis
Many - if field values aren’t unique or if you aren’t sure. Aggregation will
occur before Tableau joins.
One - if field values are unique. Aggregation will occur after Tableau joins.
NOTE: If “One” is chosen and records are NOT unique (including multiple null records),
duplicate values will occur
Referential Integrity
Determines the type of join used to get dimension values for a measure during
analysis
Some Records Match – if some values in the selected fields don’t match or you
aren’t sure. Tableau uses Outer Joins, and all measures will show (even unmatched
measures)
All Records Match – if all values in selected fields have a match in both tables.
Joins are optimized with Inner Joins, but records can be removed/missing due to
unmatched values.
NOTE: “All records match” treats records as if there are no null records in matching fields.
*Copyright Maven Analytics, LLC
Interface Differences (2020.2)
DATA SOURCE INTERFACE DATA GRID
Pre-2020.2 Pre-2020.2
Physical Layer (Joins & Unions) Shows all records in combined table resulting from join.
2020.2+ 2020.2+
Logical Layer (Relationships) Physical Layer (Joins & Unions) Shows all records for the individual table selected in the relationship.
2020.2+ 2020.2+
Individual View Data Preview by Table TableName(Count) = Source Record Count
Relevant dimension domains are shown across Resolve aggregations to the measure’s
Relevant tables Resolve native level of detail
Contextual joins are created and applied at the viz-level, and dynamically change the join type
based on the combination of dimensions and measures selected
If dimensions in the view are from a single table, Tableau will show all dimension values even if no
Remain matches exist in the measure tables (think left join)
Store ID = Store ID
Combining dimensions across tables displays only records where matching fields are found between the
Relevant tables (think inner join)
Store ID = Store ID
Store ID = Store ID
Store Lookup [Neighborhood]
Recover unmatched dimensions by bringing in the respective “Count” field. In the below case, bringing
Recovered in CNT(Store Lookup) allows us to view Neighborhoods without Home Stores.
Store ID = Store ID
Store Lookup [Neighborhood]
Unmatched measure fields (excluding the default source Count fields) will display as null by default,
Represented but can be displayed as zero using the ZN() function
Store ID = Store ID
Use the “Count” field from the table you want to remove nulls from and choose > 1 to remove nulls
Removed without removing ALL nulls (such as Neighborhoods without a home store)
Store ID = Store ID
Sales by Store
Store Lookup [Store Type]
[Quantity Sold]
Smart aggregation allows measures to aggregate at the level of detail of their pre-join source
Replicate Replicate measures across lower levels of detail in the viz only
Store Lookup
Store ID = Store ID [Neighborhood]
Customer Lookup
Sales by Store [No Field]
[Gender]
With a join, the many-to-many relationship between the Store Lookup and Customer Lookup tables would multiply
Food Inventory values to incorrect proportions. Relationships replicate across measures in the view.
Store Lookup
Store ID = Store ID [Neighborhood]
Customer Lookup
Sales by Store [No Field]
[Gender]
Subtotals resolve to the measure’s native aggregation (Food Inventory table) and do not aggregate replicated values across
dimensions.
THE The manager at your favorite bookstore, Coffee & Books, has enlisted your help to bring
SITUATION their data together. You’ll need to use table relationships to create a data model for
the team to use to support their business.
THE The team needs you to create a dynamic data model for their team to accurately analyze
BRIEF sales, profits, and product mix. The key will be to create a data source that is extremely
flexible, but also provides peace of mind that the values in the reports are correct!
• Elevate the visual appeal of your • Swap visuals, measures and • Leverage set & parameter
dashboard using external design dimensions to facilitate flexible actions to enable deeper analysis
tools and dynamic visual analysis and keep users and app-like interaction with
techniques engaged your visualizations
Background templates provide visual frameworks Information indicators come in many forms including
for developers to build dashboards. Templates are KPI shapes, Info Icons, Instructions/Commentary
both creative and practical tools for design.
These devices communicate complementary data to
Note: Templates do not refer to “Chart Templates”, but rather better inform consumers of dashboards
visual guides to overall dashboard design
PowerPoint
Create background in
PPT, save as image file
Tableau Sheets
Sheets are created
and floated on the
dashboard pane
PRO TIP: Create background templates for each device (desktop, phone,
tablet) and bring into your default view for dynamic template usage.
1 Container Button
Use containers with buttons to enable
toggling of an instruction panel.
2 Custom Image
Create an overlay image (in PPT)
that is semi-transparent and
embedded in a container.
Dimension/Measure 1
Dimension/Measure 2
Field swapping allows users to dynamically change Containers allow users to swap out entire visuals
the fields being displayed INSIDE a visualization or reveal additional filters or information
Multi-Dimensions enable users to dynamically swap out dimensions used in Tableau visualizations,
and can be created in 3 steps:
Create a parameter to allow users to Create a calculated field using a case statement Create a visualization using the dimension
select desired dimension to display driven by the previously created parameter calculated field and selector
NOTE: Use integer for faster performance NOTE: While IF statements can also be used, CASE
and a text display label statements are best for this use case
Multi-Measures enable users to dynamically swap out measures used in Tableau visualizations,
and can be created in 3 steps:
Create a parameter to allow users to Create a calculated field using a case statement Create a visualization using the multi-
select desired measure to display driven by the previously created parameter measure calculated field and selector
NOTE: Use integer for faster performance NOTE: Aggregation must be applied at this level if differs
and a text display label by measure
Dynamic Aggregation:
Outer Container
Used to house multiple
sheets within Parameter Selector
Parameter drives a calculated
field placed on filter shelf – if
sheet has no data it shrinks.
Compressed Sheet
Sheet is shrunk to 1px width when
parameter driven filter is applied.
Button Style
Text or Image are options. Text will display flat text, while image
will all for custom icons
Button Appearance
Text/Icons need to be chosen for “shown” and “hidden” states
Image
Allows you to choose custom images/icons (default options are
menu stack and X)
Select container and choose “Add
Border/Background
Show/Hide Button”
Add a border color or background color to the button
NOTE: Content (sheets, images, text, etc.)
needs to be added to a container for this Tooltip
option to show Flat text displayed when hovering over the button
Name
1 Create Parameter Action 2 Customize Settings Choose parameter action name
Source Sheets
Select sheets to where action will be
generated from
Run action on
Choose to action on Hover, Select, or Menu
Target Parameter
Select parameter to be impacted by the
action
Value
Select field from source sheet to push to
parameter
Create a parameter action from the dashboard > actions
menu (shown as “Change Parameter” in the action menu) Aggregation
Select an aggregation type for field (if
NOTE: Parameter actions cannot be created from a sheet directly as applicable)
filter actions can be
Source Sheet
2 Place calculated field on source sheet. Value
will be pushed to parameter via action
Parameter Action
3 Action will pull calc field from source
sheet and push to parameter
Multi-Metric
Normal multi-metric is dual axis to show
true value against difference from
Index Date
Selected date that is pushed by a
parameter action into a parameter
Color Legend
Sales metric is applied to color to
maintain primary metric coloration
Outer Container
Used to house multiple
sheets within
Compressed Sheet
Sheet is shrunk to 1px width when
parameter action driven filter is applied.
Name
1 Create Set Action 2 Customize Settings Choose set action name
Source Sheets
Select sheets to where action will be
generated from
Run action on
Choose to action on Hover, Select, or Menu
1
Set & Set Action
Set is created from the higher- 2 Calculation
level hierarchy dimension, which The calculation defaults to blank when the
is subsequently pushed by the set is not engaged (by default the set action
set action when selected returns to empty)
When engaged, the sub-dimension appears
Create Set
1 Create base set which will
accept values from set action
Calculated Field
2 Calculated field will show metric only
when set dimensions are enabled
Set Action
3 Set action will push selected dimensions to
calculated field (which is applied to color)
Workbook Default
By default animations are turned off (but
can be turned on at a workbook level)
Duration
Duration can be set from fast (0.3s) to
slow (2.0s) or even a custom value
Style
Style can be simultaneous (at the same
time) or sequential (in order)
Selected Sheet
Animations can be customized at a sheet
level for sheets selected
THE To better navigate the analytics career market, you’ve decided to utilize your data
SITUATION visualization skills to create a custom analytics career dashboard.
THE Your goal is to develop a robust dashboard that allows you to quickly swap fields and visuals,
apply custom-focused dimensional comparisons, and enable fast filtering and interaction.
BRIEF
Everything will need to be both functional and beautiful – this dashboard will serve as both an
analytics tool as well as a personal portfolio piece!
Geospatial data comes in two primary forms: geographic fields and spatial data files
View Toolbar
Enables map search, panning,
zoom, and multiple mark selection
Map Layers
Control the coloration, level
of geographic detail and
integrated data layers
Data Pane Fields
Geographic fields show in the
data pane with a globe icon
There are several common use cases that analysts can use to explore and visualize geospatial
data in Tableau, including heat maps, density maps, point distribution charts, and more:
Spatial functions can be used for advanced analysis or to combine spatial and non-spatial data
MAKELINE Generates a line mark between two points =MAKELINE ([Geometry 1], [Geometry 2])
Custom territories allow users to dynamically select or consolidate geographic areas using
traditional Tableau grouping functionality
Geographic Group
Groups are created using
geographic fields (i.e. State/Zip)
Mapping hierarchies allow users to drill into custom geographic levels of detail within a map
Geospatial customization provides additional mapping options and tool extensibility including
custom formatting, 3rd party maps, and custom background images
• Advanced formatting tools and 3rd party • Custom backgrounds allow you to customize
maps enable a deep level of visuals or create non-traditional maps (i.e.
customization within Tableau Desktop office spaces or factory floor plans)
Map layers can be customized to format map colors, boundaries, labels and built-in data layers
Background
Default mapbox/openstreet
map styles built into Tableau
https://www.terrestris.de/en/openstreetmap-wms/
PRO TIP: You can save WMS connections as .tms files to allow others to easily connect to WMS map connections
Mapbox’s free account allows for 50,000 views / 200,000 tile requests per month.
This is important to consider before integrating with production / client work!
Background images are custom visual layers behind your coordinate-based data points
Coordinates
X/Y coordinates can be plotted on top of a
custom background image (using native
Tableau annotations or 3rd party tools
Marks
Unique location dimensions
are added along with desired Native Tableau Annotation:
measure values/metrics
Edit Locations
Use edit locations to either add spatial fields to help
Tableau identify locations (i.e. adding state to a city map
when duplicate cities exist) or define lat/long points
Filter Data
Filter out the lat/long points in question (useful for true errors
or false records, but be careful not to exclude valid records!
PRO TIP: Zip codes are often the source of nulls. Be sure to code zips as strings and/or pad zeros for zips less than 5 characters!
THE As part of your analytics side-hustle, you’ve been hired as an analytics consultant by FEMA
SITUATION (Federal Emergency Management Agency) as part of the National Dam Safety Program (NDSP).
For this project, you will be utilizing the National Inventory of Dams database to provide a
THE
public-facing informational campaign tool to the NDSP.
BRIEF
You’ve been asked to conduct a geospatial analysis to identify high risk dams within
communities targeted for potential rehabilitation grants.
Advanced calculations go beyond basic Tableau functions to help solve specific, complex use cases
• Regular expressions (RegEx) • Table calcs allow you to • Level of detail (LOD)
leverage text-based search create custom calculations expressions allow users to
pattern algorithms to that exist within the scope dynamically control the
find/replace string values of a specific visual grain of your analysis
Regular expressions (RegEx) use special characters to define search patterns and find/replace text
RegEx Function Target Field Metacharacters Capture Group Character Class Quantifiers
Tableau regular Tableau field or Denoted by a character Denoted by Denoted by square Defines the acceptable
expression parameter that is preceded by a backslash, parentheses, these are brackets, these can be used number of previous
function used to the subject of the these determine the used to capture exact in place of character literals characters,
call a specific regular expression matching logic: word/text matches: (exact word matches): metacharacters, groups or
action: sets:
REGEXP_REPLACE . Match any character (abc) [abc] any of a, b, or c * match preceding 0 or more times
REGEXP_MATCH \d Match any digit (Douglas) [^abc] not a, b, or c + match preceding 1 or more times
REGEXP_EXTRACT \w Match a word (Apple) [a-g] character between a and g {n} match preceding n times
REGEXP_EXTRACT_NTH \s Match a whitespace [1-3] number between 1 and 3 {n, } match preceding n or more times
\t Match a tab {n,m} match preceding between n and m
\n Match a new line ? Match preceding 0 or 1 times
PRO TIP: Tools like regexr.com or ICU Project Userguide are great resources to help you master regular expression syntax!
Returns a copy of the given string where the regular expression pattern is replaced by the
REGEXP_REPLACE replacement string
Returns true if a substring of the specified string matches the regular expression pattern
REGEXP_MATCH
=REGEXP_MATCH ('-([1234].[The.Market])-','\[\s*(\w*\.)(\w*\s*\])’) = true
Returns only the portion of the string that matches the regular expression pattern
REGEXP_EXTRACT
=REGEXP_EXTRACT ('abc 123', '[a-z]+\s+(\d+)') = '123'
Returns the portion of the string that matches the regular expression pattern. The substring is
REGEXP_EXTRACT_NTH matched to the nth capturing group, where n is the given index.
Dimension Filters
Measure Filters
Table Calc Filters Quick access to common table calculation Includes more options than
options, based on fields in the view Quick Table Calculations
Addressing Fields
Define the direction in which a
calculation is evaluated (i.e
down, across, across then down)
Partitioning Fields
Define the level or group at
which table calcs are evaluated
(i.e cells, tables, panes)
Position-based table calcs are valuable tools for advanced analytics, such as calculating
metrics like Employee CAGR (continuous average growth rate)
FIRST
Returns the number of rows
LAST
from the current row to the Returns the number of rows
first row in the partition from the current row to the
last row in the partition
Extract Filters
Context Filters
Dimension Filters
Measure Filters
Context Filters
Sets, Conditional Filters,
Top N, Fixed LOD
Dimension Filters
Include/Exclude LOD, Level of Detail Element Dimension Declaration Aggregate Expression
Data Blending
Specified LOD types are Defines the grain at which Calculation to be performed
Measure Filters Include, Exclude and Fixed the data is aggregated at the grain defined
Coarser Grain
Exclude LOD (More Aggregated)
Exclude
Calculated at a coarser grain (higher)
than the view. These calculations are
impacted by filters/dimensions in the view. Repeat
Values
View View level of detail
Include LOD Fixed
Calculated at a finer grain (lower) than
the view. These calculations are impacted
by filters/dimensions in the view. Aggregate
Include
Fixed LOD Finer Grain
(Less Aggregated)
Calculated at a finer or coarser grain than
the view. These calculations are NOT
impacted by filters/dimensions in the view
unless specifically called out or in context!
PRO TIP: Use table-scoped LOD calculations by adding curly brackets around
a field {min([Order Date])}, instead of a fixed LOD {FIXED : min([Order Date])}
Dynamic Flag:
FIXED LOD
By fixing on [Customer Id] we can segment order
frequency into buckets to be analyzed as bars
FIXED LOD
By fixing on [Customer Id] we can create customer
cohorts and layer them as stacked bar colors
New customer acquisition allows analysts to track net new customers, over time or segmented
by various dimensions (i.e. markets, traffic sources, etc.)
Table Calculation
Customer count is placed on rows and layered
with a running total to show cumulative trending
THE The Boston Police Department (BPD) commissioner is looking to analyze employee
SITUATION earnings in his department. Concerns about pay increases and comparisons to the
Boston Fire Department have recently raised public interest in this topic.
THE You’ve been asked to analyze a multi-year employee earnings dataset provided by the
BRIEF city of Boston. Since this is public data, the BPD wants to ensure that reports are 100%
accurate and crystal clear in order to promote transparency within the department and
to the general public.
Predictive analytics is about determining the likelihood of future outcomes based on historical data
• Tableau Desktop provides both internal and external tools to enable predictive analytics
• Tableau includes several out-of-the box • Tableau also integrates with third-party
predictive analytics tools, including: programming languages and tools, including:
• Regression (trend lines) • Python
• Forecasting • R
• Control charts • Matlab
• Cluster analysis • etc.
Example: If one loaf of bread Example: Efficiency of Example: Computing power of Example: Revenue over Example: The trajectory of a
costs $2, 4 loafs will cost $8 warehouse workers over time microchips over time (power time for a new product skipped stone over time
(eventually maxes out) doubles every two years – launch
Moore’s Law)
Is my trendline ACCURATE?
R-Squared
R-Squared explains how the variance of one
variable explains the variance of another, ranging
from 0-1 (closer to 1 = more accurate)
Example: If R-Squared = 0.50, then only half of the
observed variation can be explained by the model's
inputs
P-Value
P-Value is the probability of obtaining results as
extreme as the observed results, ranging from 0–1
(closer to 0 = more accurate)
A P-Value of <0.05 is a common standard for
model accuracy and means that your trend-line is
strong predictor for future data points
Forecast algorithms evaluate patterns in historical data to project potential future data points
• Tableau provides several drag-and-drop forecast tools in the analytics pane
Source Data
Aggregate by gives you date granularity options
down to the second. You can also ignore a defined
number of data points and fill missing values with
zero
Forecast Model
• Automatic (default)
• Automatic without Seasonality – Removes
Seasonality
• Custom – Adjustable trend and seasonality options:
Exact dates are not supported in Tableau for forecasting. Use truncated dates like Feb 2017 or
continuous dateparts (Year, Year + Quarter, etc.). At least 5 datapoints are required for a forecast, • Additive – Contributions of the model are
at least 2 seasons for seasonality, and at least 24 months for a 12-month seasonal cycle. summed
• Multiplicative – Some contributions are multiplied
Control charts are a statistical tool designed to monitor manufacturing or business processes to
ensure they are in a state of control (within limits)
• Control charts can be generated in Tableau using reference bands
Value
Percentage, Percentile, Quantile, or Std. Dev
Label
None, Computation, Value, or Custom
Tooltip
Automatic, Custom, or None
Formatting
Line, Fill Color, Fill Above/Below, and
Symmetry
Show Recalculated Band
Recalculate based on the user’s selection
Number of Clusters
The number of clusters will be determined
automatically (using the Calinski-Harabasz
criterion) unless explicitly defined by the user
install.packages(“Rserve”) SCRIPT_BOOL
library(Rserve)
Rserve() SCRIPT_INT
https://cloud.r-project.org/index.html
SCRIPT_REAL
SCRIPT_STR
https://github.com/tableau/TabPy
https://www.python.org/downloads/
Remember that R/Python are complex languages which require a base-level proficiency to be utilized
inside Tableau. Tableau leverages calculated fields to run R/Python Scripts, but users should know the
languages first to effectively utilize R/Python inside Tableau.
Dashboard extensions are web applications created by Tableau partners, designed to help users
customize and enhance standard dashboards
THE The World Health Organization has been generating significant press for a recent study
SITUATION on global life expectancy, and has asked you to help conduct some statistical modeling
and predictive analysis to better understand the data
THE For this project you’ll need to apply predictive analytics tools in Tableau to explore trends,
build forecasts, and conduct a cluster analysis using the WHO life expectancy dataset.
BRIEF
Your job is to find key nuggets of information to help guide the team as they target regions
to investigate in their future research.