Tableau for Data Analysis_Part 3
Tableau for Data Analysis_Part 3
1
Pre-requisites
Hope you have gone through the self-learning content for this session on the PRISM portal.
By the End • Use sorting, building hierarchies, groups, sets,
filters and tooltip.
3
Pop Quiz
• Sorting the data is a very important feature in analyzing the data. Sorting helps us to
arrange the data in ascending or descending order.
• There are multiple ways to sort a visualization with single-click sort buttons.
• In all cases, one click sorts ascending, two clicks sorts descending, and three clicks clear
the sort.
In this example, the sort is applied to Color based on Metric A. The sort is applied to the innermost dimension, which
is Color in this case.
Sort from a Header
Steps:
In this example, the sort is applied to Material (sorting the order of the columns Paint, Fabric, and Paper) based on
the values for Green, since that header was used for the sort.
Sort from a Field Label
Steps:
The default option is alphabetical sorting, but there is also a menu where we can choose to sort
by a field in the view.
Sort from Tool Bar
Steps:
2. If you do not select a field before sorting, the default behavior is to sort the deepest
dimension.
NESTED NON-NESTED
A nested sort considers each pane independently A non-nested sort considers the value across panes
and sorts the rows per pane. and will have the same order of values per pane.
Purple is sorted above Green for Fabric and Paper, Purple is above Green for all materials because, in
but below Green for Paint. aggregate, Purple is higher than Green.
Nested sorts look correct within the context of the Non-nested sorts may look incorrect in a single pane,
pane, but don't convey the aggregated information but consistently convey how the aggregated values
about how the values compare overall. compare overall.
1. Using the Filters shelf: The Filters shelf is located on the left side of the Tableau window. It
is a convenient way to add and manage filters for your view.
2. Using filter cards: Filter cards are a more interactive way to filter data. They can be
displayed in the view itself, or in a separate pane.
3. Formatting filters: You can format filters to make them more visually appealing and easier
to use. For example, you can change the font, size, and color of the filter text.
Hierarchies
• Custom hierarchies enable users to drill down and analyze data at various
levels for more in-depth insights.
• Creating hierarchies involves dragging and dropping fields in the Data pane,
and additional fields can be added or re-ordered within the hierarchy.
Hierarchies
• Groups can be used in calculations, filters, and sorting operations, and can
be edited or deleted as needed.
Group
• When you group visually in Tableau, you can manually select and group multiple
marks or data points directly in the visualization.
• Visual grouping allows you to quickly create ad-hoc groups without modifying the
underlying data structure.
• By selecting and grouping marks, Tableau automatically creates a new group with a
distinct color and visual representation.
• Group labels help improve the clarity and understanding of the data by
providing meaningful names for grouped categories.
• With group labels, you can create more descriptive and informative
legends or tooltips, enhancing the overall interpretation of the data.
Poll Time
▪ Sets allow for flexible data grouping and analysis, focusing on a specific
subset of data for deeper insights.
▪ They can be used to compare and analyze data within and across
different dimensions.
• Fixed sets are defined by specific conditions and remain unchanged with filters or
user interactions.
• Sets are versatile tools used in calculations, filters, and visualizations for focused
data exploration and analysis, enabling pattern identification, outlier detection,
and data-driven decision-making.
Tooltip
▪ To add a tooltip command button, edit the tooltip for a specific mark or
data point in the visualization.
• Tooltips in Tableau are interactive elements that enhance the understanding of data
by providing additional details and insights.
• Tooltips are interactive elements in Tableau that appear when hovering over or
clicking on data points.
• Tooltips prevent clutter by displaying information that may not fit directly into the
main visualization.
• They can include specific data values, calculated fields, descriptive text, and visual
elements like images or charts.
Pop Quiz
d. Providing additional details and context for each data point on hover
Pop Quiz
d. Providing additional details and context for each data point on hover
Calculated field
• They provide flexibility to manipulate data and create calculated fields not present in
the original dataset.
• String functions help with tasks like extracting substrings, converting case,
finding patterns, replacing text, and more.
Function Description
LEFT(str, n) Returns the leftmost n characters from a string.
Function Description
Function Description
• Date functions help with tasks like extracting components, performing date calculations,
formatting, and aggregating data based on dates.
Function Description
DATE(date_part, value) Constructs a date using the specified date part values.
Extracts a specified part (such as year, month, day, hour, etc.) from a
DATEPART(date_part, date)
date and returns the extracted value.
Returns the name of a specified part (such as year, month, day, hour,
DATENAME(date_part, date)
etc.) from a date.
Function Description
DAYNAME(date) Returns the name of the day of the week for a date.
• Delved into sorting, hierarchies, and groups to slice and dice data effectively.
• Learned the power of sets and filters to focus on specific data subsets.
• Developed calculated fields with string, logical, and type conversion functions.
• Acquired skills to manipulate, analyze, and visualize data for informed decision-making.
Activity
Pre-requisites: Familiarity with basic data manipulation in Tableau, understanding of calculated fields.
Scenario: You work for a retail company and want to analyze the sales performance of different
product categories in specific regions. Additionally, you want to calculate a new metric that assesses
profitability based on discounts and costs.
Expected Outcome:
A Tableau workbook with two worksheets:
• A visualization showing the sales performance of product categories in different regions.
• A visualization displaying the calculated profitability metric for each sale.
Activity
Steps:
1. Data Preparation: Load your sales data into Tableau, ensuring it includes columns for product categories, regions,
sales amounts, discounts, and costs.
4. Dashboard Creation: Combine both worksheets into a dashboard, allowing for easy comparison and insights.
Next Session:
Advanced Calculations in Tableau
THANK YOU!
Advanced Calculations in Tableau
4
Pre-requisites
Hope you have gone through the self-learning content for this session on the PRISM portal.
By the End • Demonstrate proficiency in executing quick table
calculations for rapid insights.
5
Recap
Pop Quiz
Quick table calculations allow us to quickly apply a common table calculation to your
visualization using the most typical settings for that.
calculation type. This slide illustrates how to apply a quick table calculation to a visualization
using an example.
The following quick table calculations are available in Tableau for you to use:
Function Description
Running Total Calculates a cumulative total or running sum.
Computes the difference between consecutive values in a field
Difference
or table calculation.
Function Description
b. Running Total
c. Percent of Total
d. Moving Average
Poll Time
b. Running Total
c. Percent of Total
d. Moving Average
Level of Details (LOD)
Level of Detail (LOD) is a powerful concept in Tableau that allows you to control the granularity of data analysis and
calculations independently of the visualization's level of detail. It enables you to perform calculations and aggregations
at different levels within the same visualization, providing flexibility and precision in data analysis.
LOD expressions are used to create calculated fields that define the scope of data you want to consider in calculations.
They provide three main types of expressions:
• INCLUDE: Focuses on specific dimensions while retaining context from other dimensions. It allows you to perform
calculations for selected dimensions while considering all others.
• EXCLUDE: Ignores specific dimensions while retaining context from other dimensions. It enables you to calculate
values for a specific dimension while disregarding others.
• FIXED: Locks the dimensions you want to analyze, ignoring the current view's filters. It's useful for creating
context-independent calculations.
Include Level of Details (LOD)
• Include Level of Detail (LOD) expressions in Tableau enable calculations that include additional dimensions while
preserving the current level of detail.
• They are denoted by the keyword "INCLUDE" followed by the dimensions within square brackets [ ].
• Include LOD expressions that are useful when you want to perform calculations at a higher level of detail while still
considering specific dimensions.
• They allow for aggregating data from additional dimensions without affecting the current level of detail in the
visualization.
• Include LOD expressions provide flexibility in calculations by incorporating additional dimensions while
maintaining the desired level of detail.
Exclude Level of Details (LOD)
• Exclude Level of Detail (LOD) expressions in Tableau enable calculations that exclude specific
dimensions while preserving the current level of detail.
• They are denoted by the keyword "EXCLUDE" followed by the dimensions within square brackets [
].
• Exclude LOD expressions are useful when you want to perform calculations while excluding certain
dimensions from the analysis.
• They allow for filtering out specific dimensions without affecting the current level of detail in the
visualization.
• Exclude LOD expressions provide flexibility in calculations by excluding dimensions from the
analysis while maintaining the desired level of detail.
Fixed Level of Details (LOD)
• Fixed Level of Detail (LOD) is a type of calculation in Tableau that allows you to create a context-
independent measure by "fixing" the dimensions you want to analyze.
• Unlike other LOD expressions like INCLUDE and EXCLUDE, which respond to filters and dimensions
in the visualization, the FIXED LOD calculation maintains a consistent reference point regardless of
the view's context.
• A FIXED LOD calculation freezes the dimensions you specify, ensuring that the calculation remains
constant and unaffected by changes in filters, dimensions, or other contextual factors.
• Fixed LOD calculations are valuable when you need to analyze data in isolation from the current
view's dimensions or filters.
• They are particularly useful for creating reference lines, benchmark values, or consistent measures
that remain constant across different perspectives.
Level of Details (LOD)
Pop Quiz
• They can be used in calculations, filters, and various parts of the workbook.
a. Numeric parameter
b. String parameter
c. Date parameter
d. Boolean parameter
Poll Time
a. Numeric parameter
b. String parameter
c. Date parameter
d. Boolean parameter
Demo – Advanced Calculations in
Tableau
Pop Quiz
a. IF-THEN
b. IF-THEN-ELSE
c. IFNULL
d. ISNULL
Pop Quiz
a. IF-THEN
b. IF-THEN-ELSE
c. IFNULL
d. ISNULL
Summary
• Dived deep into advanced calculations and parameters in Tableau to elevate our data
analysis skills.
• Harnessed Include and Exclude LOD calculations for targeted analysis, answering
complex questions.
Scenario: You're analyzing employee performance data across different departments and regions. Your
goal is to create a reference line that indicates the average performance score across all departments,
unaffected by any filters or selections.
Expected Outcome: Users will create a visualization with a fixed reference line representing the overall
average performance score.
Steps:
1. Calculate the average performance score for all departments using a Fixed LOD expression.
2. Add this fixed average as a reference line to a bar chart showcasing department-wise performance.
3. Apply filters and selections to the visualization and observe how the reference line remains constant,
offering a consistent benchmark.
4. Create a dashboard that showcases both the original visualization and the one with the fixed
reference line.
5. Explain the benefits of using Fixed LOD to ensure consistent measurement even with changing filters.
Session Feedback
Next Session:
Formatting in Tableau
THANK YOU!