0% found this document useful (0 votes)
8 views27 pages

Session 9-11 Tableau

Uploaded by

jay lakhani
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)
8 views27 pages

Session 9-11 Tableau

Uploaded by

jay lakhani
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/ 27

Introduction

to
Tableau
Tableau: a group of models or motionless figures representing a scene from a story or from history
Tableau Components
Connect to the data
Worksheets:
◦ Contains individual visualizations
Dashboards:
◦ Contains one or more worksheets
Stories:
◦ Combination of worksheets and dashboards
◦ Presentation environment
Create a worksheet
Name a worksheet Integer: Any whole number (i.e. no decimals)
Float: Any number including decimals
Undo/Redo/Clear  Sheet
Tableau Workspace
Data pane: • Cards & Shelves:
◦ Data source
• Columns and Rows shelves
◦ Dimensions
◦ Categorical variables
• Filtering data: Data is excluded
◦ Slicing variables from calculations and other
◦ Measures computations performed on the
◦ Continuous variables summarized data in the table.
◦ Sets • Hiding data: Doesn't display in the
◦ Subset of records view, but it is still included in
◦ Parameters calculations.
Marks card – Key element
Gives visualization detail and context
◦ Allow to modify a view’s design, visualization type, user experience, and
granularity of analysis all in one place
◦ Adding more dimensions/measures  Increased Granularity
Marks Cards: Color, Size, Label, Detail, Tooltip, and Shape.
◦ Allows to “encode” the marks on a view
◦ Encoding marks adds depth to analysis by mapping marks to colors, sizes, and / or
shapes to add context to a view.
◦ Encodings will be carried on to other views as they are created.
Label and Tooltip Marks Cards
Dataset: Hospital visits
1. BAR CHART: Compare the revenue between various departments in the
hospital
1. Arrange it in descending order (SORT)
2. Show only the top 10 departments. (FILTER)  Dept Filter
3. Add Hospital Goal.csv
1. Drag Goal to columns Select Bullet chart
4. Group and highlight some departments
1. Create calculated value: sum(revenue)>= sum(goal)
2. STACKED BAR CHART: Compare the revenue for the year 2019 to the year
2018 for different Department Types
1. Edit colors
2. Group ICU & Natal Together
1. Right-click each bar -- select Mark label-- Always show.
Dataset: Hospital visits
4. CIRCLE CHARTS : Compare doctors within same department in terms of
average minutes to service
Dept Type (rows)- AVERAGE Mins to Serve (Col)
Change x-axis scale – Right clk- Edit axis- Custom -- Fixed start
Slice by Doctors Drop Doctors in Detail card
Drop Department type to color card – Change circle size
Introduce average line for easier comparison
Box-plot
5. HISTOGRAM
◦ Minutes to Service Histogram
◦ Select Minutes to Service -> Select histogram
◦ Creates dimension ‘Minutes to Service (bins)’
◦ Change Bin Size
Dates
Row: Revenue
Column: Year (date of admit)
Built in date hierarchy
Date part: Represents a specific part of the date
Date value: Represent a date value with ref to year
Compare 2018 & 2019 revenue
◦ Use Date Part and slice by year color
◦ Create year lable
Dual Axis chart- Revenue vs No. of patients
Heatmap
Rows: Days
Columns: Month
Detail by Count of patients
Change color
TREE MAPS
◦ Department Type and Department – Rows
◦ Revenue – Column
◦ Click Tree map.
◦ Change color card of Department Type

SCATTER PLOT
Revenue vs No. of patients visit
◦ Slice by Department
◦ Slice with months – Date part & Date Value
Introduction to calculations
Results:
 Per row of data (Row-level calculation)
 At aggregate level
 Level of detail calculations:
 Aggregations that are performed at a specified level of detail, with the results available at the
row level

 Table calculations:
Calculations are performed on the table of aggregate data that has been returned by the data
source to Tableau.
Introduction to calculations
 Calculations will show up as either a new measure or dimension/field
 made up of functions, operations, and references to other fields,
parameters, constants, groups, or sets
Dataset: Vacation Rentals
 Concatenating strings  ‘+’
 Create Full name from First and last name

 Split strings  SPLIT ()


 Create building names and room numbers as separate variables
 Alternate: Transform  custom split

 IF and ELSEIF
 Create the floor number of the rooms as a separate variable “Floor”
IF LEFT([RoomNo],1)= "1" THEN "First Floor" ELSE "Second Floor" END
Aggregate calculations
 Create discount percentage at room level, floor level and property level
 SUM([Discount])/SUM([Rent])
Row-wise sum vs column-wise sum
 AGG indicates that aggregation is defined in the calculation.
 Cannot mix aggregate and non-aggregate arguments with this function
 E.g.: [Discount] / SUM([Rent])

 Change into percentage


 right-click the Discount % -- Default Properties -- Number Format – Percentage

 Display table of Bldg Name- Room No – Rent- Discount – Discount %


 Duration of stay per Guest
Fix “Year” of date field
Concatenate strings  +”-”+”2022”
Convert to date type
 Duration: DateDiff()
Calculate Revenue per Guest
 (((1+([Tax per Night]/100))*[Rent])* [Duration])-[Discount]
 Create Total Revenue at room level, floor level and property level
Table Calculations
 Create a table showing different table
calculations for sales

Quick Calculations
 Running Total: Cumulative total
 Difference
 Rank
 Running Total (Sales) -- Edit Table Calculation – Compute using ‘Pane down’ (starts for every
quarter)
 Difference Total (Sales) -- Edit Table Calculation – Calculation Type – ‘Percent Difference from
quarter)
 Convert the difference quarter-wise : Compute using – Pane down
 YoY Growth rate
LOOKUP(expression, [offset]) : Returns the value of the expression in a target row, specified as a
relative offset from the current row.
 Lookup(ATTR([Category]), -1)
Level of detail (LoD) calculations
 Row Level Expressions and View Level Expressions
 Row Level Expressions: Unaggregated expressions computed for each row
 View Level Expressions: Aggregated expressions computed by the dimensions in the view
 Encloses in AGG function

 LoD Calculations – Defined by calculations


 Aggregations at a specified level of details
 Different from the level of detail that is defined in the view

 FIXED , INCLUDE , and EXCLUDE - keywords indicating type of lod calculation


Dim 1 , Dim 2 – dimensions (more thane one dimension can be included)
 AGG  aggregate function Eg: SUM , AVG , MIN , and MAX
 Field  value that will be aggregated
 FIXED
 Independent of Dimensions in the view

 Returns the average orders per state regardless of dimensions in the view

 INCLUDE
 Aggregates at the level of detail by the dimensions in the view & dimensions in syntax

 EXCLUDE
 Aggregates at the level of detail by the dimensions in the view but excluding any listed in syntax
Create Table – Dept, Category and Sales
◦ Display Total Sales across tables -- {FIXED: SUM([Sales])}
◦ Display Dept-wise Total sales -- {FIXED [Department]: SUM([Sales])}
◦ Calculate percent Sales of individual categories wrt Dept -- ([Sales])/[FxdDept]
Compare “Regional level sales” with the sales of each state in that region
◦ { FIXED [Region]: SUM([Sales])}

 INCLUDE
To perform certain calculations at levels of detail that are lower (more detailed)
than the view level of detail
Display Total Sales across categories & Avg sales per customer in that category
 INCLUDE : {INCLUDE [Customer Name] : SUM([Sales])}
 Add Include – Change Agg to AVERGE Display category-wise SUM(Sales)-

 Display Department-wise sales and average regional-profit for each of the product
categories
 Department Sales  average regional-profit
 ({INCLUDE [Region]: AVG([Profit])})

 EXCLUDE
 Compare the average profit of each department with the overall average profit
 {EXCLUDE [Department]:AVG([Profit])}
Loans.csv
 Each record is a monthly snapshot of a loan
 Was a member ever at risk?: Any member with a credit score of less than 550
(even once during the payment cycle) is considered to be at risk.
 Which loan type has the highest numbers of at-risk members?
 {FIXED [Member ID]: MIN([Credit Score])} <550
To Label percentage
 Drag member Id into marks – convert to count
 Right click—quick table calculation—select percentage
 Click compute using—across cell
Loans.csv
Latest balance for a member
 Show the latest balance for each member across loan types
 Create function to extract latest date
 Since one customer has more than one loan type- fix both membered and loan
type
 Extract max date : {FIXED [Member ID],[Loan Type]:MAX([Date])}
 To extract the Balance corresponding to the date: convert the function to filter
 {FIXED [Member ID],[Loan Type]:MAX([Date])}=[Date]
 INCLUDE
What is the average number of loans per member on a state-by-state basis?
 Draw states across map—draw loanId – convert to count
 Cannot find average
 Create a syntax for count across members and then find average
 {INCLUDE [Member ID] : COUNTD([Loan Number])}
EXCLUDE
 How does the average credit score for a given loan type compare to the overall
average for the entire portfolio?
 Show the difference between the average credit score of a loan type and the
overall average of the portfolio as a bar chart
 Exclude the loan type while calculating the portfolio level average:
 {EXCLUDE [Loan Type]: AVG([Credit Score])}

You might also like