Tableau Calculations / LOD Calculations
Level of detail calculations: - Normally, a measure is aggregated by the dimensions in a view, though
"LOD Expressions represent an elegant and powerful way to answer questions involving multiple levels of granularity in a single visualization." "LOD Expressions allow you to determine the levels of detail (i.e., the dimensions) used in a calculation without actually dropping those dimensions into the visualization." - {[TYPE] [Dimension 1],[Dimension 2] : AGG([Measure])}
Ad-Hoc Calculations
- Adds calculated fields to shelves but NOT the data pane. - The Ad-hoc calculation does not become part of the original data set.
3 ways to make a calculated field
1. Analysis= create calculated field 2. Dimension= create calculated field 3. Right click (in data pane)= create calculated field
How to create table calculations
1. Use Drop Down Menu on Pill in View 2. Choose Quick Table Calculation 3. Create a Calculation using Table functions
How is data calculated in terms of direction?
Across, Down Across then Down Down then Across
Level of detail calculations: Include Type
Aggregates at the level of detail determined by the dimensions in the view and the dimensions listed in the code. most useful when including a dimension that isn't in the view. { INCLUDE [Customer Name] : SUM([Sales]) }
Level of detail calculations: Exclude Type
Aggregates at the level of detail determined by the dimensions in the view, excluding any listed in the code. most useful for eliminating a dimension in the view. {EXCLUDE [Region]: SUM([Sales])}
Level of detail calculations: Fixed Type
Aggregates at the level of detail specified by the list of dimensions only in the code without reference to what dimensions are used in the view: { FIXED [Region] : SUM([Sales]) }
Ad-Hoc calculations
Does not become part of the data source, it is part of the visualization only Double Click in Row/Column Pane or Marks shelf
Level of detail calculations: LOD Types:
Fixed include exclude
Computer Using: What is Direction?
How calculation is made within Scope
List of Tableau Functions
Numerical - (mathematical) string - (Manipulating text strings) Date - (Date manipulation) Type conversion - (Converting one data type [ig. a number] to another eg a string] Logical - (decision making [e.g. If | Then | Else] aggregate - Aggregating values such as Sum, Avg, Min, Max, etc. user - Authentication table - operate on the aggregate data returned after the tableau query of the underlying data.
Calculation Types: Table
Performed at an aggregate level on the table of aggregate data, which has been returned by the data source to Tableau.
Calculation Types: Aggregate Level
Performed at an aggregate level where the level of detail is defined by fields used as dimensions in the view. - As the dimensions change the calculation changes. - Sum([Price]/Sum([Area])
Calculation Types: Level of Detail (LOD)
Performed based on an attribute (measure or dimension) that does NOT need to be part of the view.
Calculation Types: Row Level
Performed for every row of underlying data. - Price per square foot - [Price] / [Area]
How Does Tableau calculations work?
Row, Aggregate, and LOD are performed at the data source layer - They are part of the query sent by Tableau to the data source Table Calculations - Tableau queries the data source - Results of the query are returned - Calculations are made to the aggregated data
Quick table calculations include
Running Total Difference Percent Difference Percent of Total Rank Percentile Moving Average YTD total Compound Growth Rate Year Over Year Growth YTD Growth.
How is data in a table calculated by scope?
Table Pane -Next to last Dimension (Year / Region) cell -Lowest Level of Dimension Detail (Department/Region x Quarter/Year)
When creating a calculated field
The calculation becomes part of the data source that is currently open. That is, you are creating a new data attribute and value
Quick table calculations can be applied to
any measure used in a view
Compute Using: What is Scope?
boundaries that are used in a calculation
Calculation Types
row level aggregate level level of detail table