LOD In Tableau: Types, Examples, And More
Tableau is a popular Business Intelligence and Data Visualization tool with an ever-growing community of over 1 million members. According to research, over 46,000 companies are using Tableau today. One of the most amazing features of this tool is LOD in Tableau. These allow users great precision and flexibility when analyzing their data at different levels for better insights. In this blog, we will be delving into Tableau LOD with its examples and use cases.
What is LOD in Tableau?
Tableau 9.0 introduced the feature of Level of Detail (LOD) Expressions, allowing data to be calculated at varying levels. Ranging from INCLUDE which is more precise and detailed, EXCLUDE for less detail, or FIXED as an entirely different level. This allows users greater control when performing calculations in various contexts. Knowing how these expressions work will make it easier while computing aggregations on diverse information you may encounter during a search process; Though it could become complex if additional granularity is added into your research activities too.
Suppose you are the owner of Netflix and want to understand what customers think about it. With conventional capabilities, one can find out broad insights such as the most popular movies or genres with the highest ratings, etc. However, if LOD (Linked Open Data) expressions are used then even further details like which day during a week or month gets the maximum views would be discovered. If you’d like to get a better knowledge of how to use Tableau better you can take a comprehensive Tableau course.
Understanding the Syntax
The syntax for Tableau LOD Expressions is:
{[INCLUDE | EXCLUDE | FIXED] <dimension declaration > : <aggregate expression>}
The parameters include:
- { }: All Tableau LOD Expressions must be enclosed in curly braces.
- [ INCLUDE | EXCLUDE | FIXED ]: This defines the type of Level Of Detail calculation that should be used for our particular analysis, depending on what kind of outcome we are looking to achieve.
- < dimension declaration >: Here is where we list all the dimensions relevant to our calculations and separate them with commas such as [Region], [State], etc.
- <aggregate expression >: In this section we specify how many aggregate conditions need to apply for any given dimension within our data set
Also Read: Filters in Tableau
Types of LOD in Tableau
In Tableau, there are three types of LOD (Level of Detail) Expressions: INCLUDE, EXCLUDE, and FIXED.
1. INCLUDE LOD In Tableau
Include LOD is an expression in Tableau that allows you to compute aggregations considering both the dimensions specified by a user and those present in the view. This can be used to create visualizations at different levels of granularity which allows for more insightful analysis from data. Allowing you to easily add or remove fields so that we can get accurate results when looking at different levels of detail.
The syntax for this feature follows as:
{[INCLUDE] <declaration of dimension>:<expression to aggregate>}.
To create INCLUDE LOD expressions, you will have to take the following steps
- Create a new sheet and name it “INCLUDE Sheet” for reference
- Create a visualization to implement the LOD Expressions
- Go ahead and drag region to columns, and sales to rows
- At this point, Tableau will autogenerate a bar chart for you
- Next, create a calculated field
- Select the “Analysis” option > choose the “Create Calculated Field” Option
- Add {INCLUDE [Customer Name]: SUM([Sales])} as formula in calculated field
- Drag the newly created calculated field from the measures panel onto rows
- This will result in Tableau automatically creating two bar charts
- Right-click on “sales per customer” pill > select Measure > Click Average option
- This will change the aggregation to average
2. EXCLUDE LOD Expressions
EXCLUDE Level of Detail Expressions can be used to focus on the calculation of dimensions at a higher degree of granularity while disregarding those from lower levels. This means that EXCLUDE LOD Expressions can help us focus on more important parts of a problem, and ignore the details we don’t need to look at.
The code or syntax for this command in Tableau is written as:
{[ EXCLUDE ] <declaration_of_the dimension >: <expression_to aggregate>}.
To create INCLUDE LOD expressions, you will have to take the following steps
- Create a new sheet. For reference, please rename it as “EXCLUDE sheet”
- Next, create a new calculated field
- Go to Analysis > Select the option of “Create Calculated Field”
- Now, rename the just Calculated field as EXCLUDE Calculation
- Write {EXLUDE [Region]: SUM([Sales])} in calculation field
- Drag Region & Sales into Rows
- Order the date (aggregate month-wise) into Columns
- Automatically, Tableau will create a line graph
- You can now change this to the Bar graph to help present the visualization in a readable manner
- To do this, () go to the marks card and change the graph type option from Automatic to Bar Chart.
- On the mark card, you’ll now drag the EXCLUDE calculation to colors
Note that these last few steps will improve the readability of the visualization
3. FIXED LOD Expressions
FIXED LOD is a feature in Tableau that enables users to create calculations using only specific dimensions without considering the other fields. It allows them to group data and perform aggregation on different levels of granularity than what’s been selected on the view itself.
The code or syntax for this command in Tableau is written as
{[ FIXED ] < declaration of the dimension > : <expression to aggregate>}
To create FIXED LOD expressions, you will have to take the following steps
- Create a new sheet. For reference, you might love to rename it as “FIXED Sheet”
- Then, go to the Analysis option & create a new calculated field
- Now, rename this field as “Sales by Region”
- Enter the formula { FIXED [Region] : SUM([Sales])} in the calculated field section
- Drag Region and States onto columns
- Also, Drag the “ Sales by Region” calculation into rows
Also Read: Tableau Projects
LOD in Tableau with Example & Use Cases
Tableau LOD Expressions are very useful for conducting advanced data analysis and creating meaningful visualizations. LOD Expressions can be used to analyze data at various depths of detail, making them a versatile tool for multiple scenarios. Additionally, they enable users to gain insight from the analysis that might have been impossible without their use. To demonstrate how LOD Expressions work and are applied in Tableau we will provide examples later on.
1. Customer Order Frequency
We can use a LOD Expression to gain insight into how many customers have placed one, two, or more orders in our dataset. The expression {fixed [Customer Number]: count([Order Number])} will give us the number of times each customer has made an order within the data set. Here are the steps:
- Create a new calculation field with the expression: {FIXED [Customer Name]: COUNTD([Order Id])}
- Drag and drop this newly created field and customer name in columns and rows shelves respectively.
- Sort by “customer name” with aggregation as count(distinct) click on “customer name”.
- Change measure to count(distinct), select the dimension, discrete.
2. Percent of Total
LOD Expressions allow us to filter a market and still measure the global contribution of each country’s revenue towards the total sales. This allows for more accurate analysis when looking at different markets which may have small contributions in absolute terms but be vital to overall sales.
3. Cohort Analysis
Cohort Analysis is a technique used to analyze customer behavior by grouping them into cohorts based on common characteristics. It helps businesses better understand their existing customers and make more informed decisions about how to retain those customers while also attracting new ones. This analysis takes data as input, breaks it down according to the given criteria for each cohort, then evaluates trends to provide valuable insights that inform marketing and business strategies. Here are the steps:
- Create a new calculation field and name it as Customer purchase date
- Enter the expression: {[customer name]:MIN([order date])} in this calculation field.
- Drag sales to rows shelves, and order date to columns shelves respectively.
- Add customer purchase date to color fields for further analysis and observation.
4. New Customer Acquisition
This LOD expression allows businesses to easily track the daily trend of customer acquisition in different markets. A sloping upward line indicates that marketing and sales efforts are performing well, while a flattened-out line suggests potential issues which should be addressed promptly.
5. Average of Top Deals by Sales Rep
LOD Expressions allow for a detailed breakdown of data by a sales rep to be viewed at the country level. This expression allows businesses to view the average of their top deals closed per sales rep, and identify which reps are performing better in closing larger deals.
Get a confirmed ₹35,000 total stipend on your first internship with our data science placement guarantee course.
Conclusion
LOD in Tableau Expressions allows users to create calculations at different levels of detail, giving them more control and flexibility. INCLUDE, EXCLUDE, and FIXED expression aggregations can be used in many different applications or cases. Using these powerful features of Tableau LOD expressions enables deeper insights into data sets that were previously impossible with Tableau alone.