EDUCBA

EDUCBA

MENUMENU
  • Blog
  • Free Courses
  • All Courses
  • All in One Bundle
  • Login
Home Data Science Data Science Tutorials Tableau Tutorial LOD Expressions in Tableau

LOD Expressions in Tableau

Priya Pedamkar
Article byPriya Pedamkar

Updated March 24, 2023

LOD Expression in Tableau

Introduction to LOD Expressions in Tableau

In this article, we will discuss LOD Expressions in Tableau. A visual analytics tool doesn’t just impart users the ability to generate visual insights from data. Rather, it also provides them the ability to aggregate data as per the requirement. However, performing the task of data aggregation isn’t simple in every situation, and sometimes certain technical and functional complexities may be involved. To take the task of aggregation further, the concept of aggregation at the view and calculation-based aggregation comes into the picture. Here, dimensions act as levels that affect the aggregation. In Tableau, the concept of LOD (Level of Detail) allows manipulating aggregation of a measure based on the requirement.

Start Your Free Data Science Course

Hadoop, Data Science, Statistics & others

Types of LOD Expressions in Tableau

There are three types of LOD expressions in Tableau they are as follows.

  • FIXED LOD Expression: In this type, the level of aggregation remains fixed, as mentioned in the calculated field.
  • INCLUDE LOD Expression: In this type, data can be aggregated on any dimension at view level along with the one mentioned in the calculated field.
  • EXCLUDE LOD Expression: In this type, data can be aggregated on any dimension at view level except the one mentioned in the calculated field.

Creating LOD Expressions in Tableau

We’ll now look into the procedure to create and use LOD expressions in Tableau. For this demonstration, we are going to use the Distribution Volume dataset. The dataset contains volume distributed across major regions in India by distribution unit. Important dimensions are the Distribution Unit, Region, DU Code, Mode, and City, while Distribution Volume is the measure in the dataset.

Through the illustrations, we’ll see the applications of the various types of LOD expressions.

Let’s proceed with the demonstration as follows.

1. Load the requisite dataset into Tableau. For this, click on “New Data Source” under the Data menu. Alternatively, click on “Connect to Data”.

Lod Expressions in Tableau 1.1

2. From the window that pops-up, select the requisite data source type. In this case, the data source type is MS Excel, so click on Microsoft Excel.

Lod Expressions in Tableau 1.2

3. The loaded data can be seen in the “Data Source” tab. Examine the data prior to proceeding to the analysis.

Lod Expressions in Tableau 1.3

4. Moving to the sheet tab, the dimensions, and the measure can be seen in the respective sections.

Lod Expressions in Tableau 1-4

5. Now, we’ll be exploring the procedure to implement the three LOD expressions, one-by-one. Initially, just bring dimensions Region and Distribution Unit into Rows region and drag the measure Distribution Volume over Text in the Marks card. We get a tabular representation of data as below. Note, we have got Distribution Volume figures by Distribution Unit by Region.

Lod Expressions in Tableau 1.5

6. In order to create a LOD expression, first, we need to create a calculated field. So, right-click anywhere in the blank portion in the Data tab, and select “Create Calculated Field”, click on that.

Lod Expressions in Tableau 1.6

7. In the create field section, observe the following code. The “FIXED” computes an aggregate based on specified dimensions only. So, the following code takes care of the fact that whatever dimension we may include in the analysis, the aggregation will always be done on the Region dimension only.

Lod Expressions in Tableau 1.7

8. The newly created calculated field “VOL_By_Region” can be seen in the Measures section as shown below.

Lod Expressions in Tableau 1.8

9. Now, bring Region and Distribution Unit dimensions into Rows region and drag VOL_By_Region dimension over Text in the Marks card. The hierarchy for distribution area is Region -> Distribution Unit -> City. However, we can find that distribution units have the same values in a region. This is due to the fact that aggregation has been fixed at the Region level.

Lod Expressions in Tableau-1.9

10. Now, we want to fix the aggregation level but ensure that aggregation can be done at other dimensions also at the view level. This can be accomplished by INCLUDE LOD expression. We created a calculated field to achieve this, which is as shown below. Observe, INCLUDE [Distribution Unit] ensures that, now, along with this dimension, average aggregation is possible on other dimensions too.

Image -1.10

11. The newly created dimension AVG_VOL can be seen in the Measures section. AVG_VOL means average volume by the desired dimension.

Image - 1.11

12. As can be seen in the below screenshot, we created a vertical bar chart giving Region-wise average Distribution Volume. Note, though in the calculated field the aggregation has been done at lower level dimension, still at view level aggregation by higher-level dimension is possible. This is owing to the INCLUDE LOD expression.

Image - 1.12

13. Sometimes, we may not be interested or mandatorily not require aggregation done by a certain dimension. In order to meet the condition, we use EXCLUDE as follows. Observe the expression in the following calculated field. EXCLUDE [Distribution Unit] ensures that aggregation by the Distribution Unit won’t work.

Image 1.13

14. The newly created field “Regional_Level_Calc” can be seen in the Measures section. The field has been named so as no aggregation is possible over the Distribution Unit dimension and Regional level analysis will be meaningful.

Image 1.14

15. Now, bring the dimensions Region and Distribution Unit into Rows region and drag the newly created field “Regional_Level_Calc” over Text in Marks card. As can be seen in the below screenshot, we get Distribution Unit wise figures by Region. However, the figures correspond to the Region level aggregation.

Image 1.15

16. The above illustration demonstrating the EXCLUDE application works similar to what FIXED does as we have seen in the preceding section. We’ll include another dimension in the analysis so as to check how EXCLUDE works.

Just observe the following screenshot. We have included dimension Mode into and removed dimension Region from the analysis. Now, we can find that for all Distribution Units, we have got the same Mode wise figures. Ideally, the correct result would have been mode wise figures for that particular distribution unit. However, in this case, while aggregating it takes into consideration the total distribution volume and just aggregates it by dimension Mode. So, essentially, there remains no relevance of including the dimension Distribution Unit in the analysis.

Image -1.16

Conclusion

While driving analytics, we never know what type of data aggregation we may require to perform. Typically, data preparation tasks prior to importing data into Tableau will do most of the work. However, in order to deal with unexpected aggregation requirements occurring in certain situations, the concept of LOD proves handy.

Recommended Articles

This is a guide to LOD Expressions in Tableau. Here we discuss the introduction and how to create LOD expressions in Tableau along with its types. You may also look at the following articles to learn more –

  1. Working with Map Layers in Tableau
  2. Creating a Workbook in Tableau
  3. New Features in Tableau
  4. Steps of Custom SQL in Tableau
All in One Excel VBA Bundle
500+ Hours of HD Videos
15 Learning Paths
120+ Courses
Verifiable Certificate of Completion
Lifetime Access
Financial Analyst Masters Training Program
2000+ Hours of HD Videos
43 Learning Paths
550+ Courses
Verifiable Certificate of Completion
Lifetime Access
All in One Data Science Bundle
2000+ Hour of HD Videos
80 Learning Paths
400+ Courses
Verifiable Certificate of Completion
Lifetime Access
All in One Software Development Bundle
5000+ Hours of HD Videos
149 Learning Paths
1050+ Courses
Verifiable Certificate of Completion
Lifetime Access
Primary Sidebar
All in One Data Science Bundle2000+ Hour of HD Videos | 80 Learning Paths | 400+ Courses | Verifiable Certificate of Completion | Lifetime Access
Financial Analyst Masters Training Program2000+ Hours of HD Videos | 43 Learning Paths | 550+ Courses | Verifiable Certificate of Completion | Lifetime Access
Footer
About Us
  • Blog
  • Who is EDUCBA?
  • Sign Up
  • Live Classes
  • Certificate from Top Institutions
  • Contact Us
  • Verifiable Certificate
  • Reviews
  • Terms and Conditions
  • Privacy Policy
  •  
Apps
  • iPhone & iPad
  • Android
Resources
  • Free Courses
  • Database Management
  • Machine Learning
  • All Tutorials
Certification Courses
  • All Courses
  • Data Science Course - All in One Bundle
  • Machine Learning Course
  • Hadoop Certification Training
  • Cloud Computing Training Course
  • R Programming Course
  • AWS Training Course
  • SAS Training Course

ISO 10004:2018 & ISO 9001:2015 Certified

© 2023 - EDUCBA. ALL RIGHTS RESERVED. THE CERTIFICATION NAMES ARE THE TRADEMARKS OF THEIR RESPECTIVE OWNERS.

Let’s Get Started

By signing up, you agree to our Terms of Use and Privacy Policy.

EDUCBA

*Please provide your correct email id. Login details for this Free course will be emailed to you

EDUCBA
Free Data Science Course

Hadoop, Data Science, Statistics & others

By continuing above step, you agree to our Terms of Use and Privacy Policy.
*Please provide your correct email id. Login details for this Free course will be emailed to you

EDUCBA

*Please provide your correct email id. Login details for this Free course will be emailed to you
EDUCBA

*Please provide your correct email id. Login details for this Free course will be emailed to you
EDUCBA Login

Forgot Password?

By signing up, you agree to our Terms of Use and Privacy Policy.

This website or its third-party tools use cookies, which are necessary to its functioning and required to achieve the purposes illustrated in the cookie policy. By closing this banner, scrolling this page, clicking a link or continuing to browse otherwise, you agree to our Privacy Policy

Loading . . .
Quiz
Question:

Answer:

Quiz Result
Total QuestionsCorrect AnswersWrong AnswersPercentage

Explore 1000+ varieties of Mock tests View more