Introduction to LOD Expressions and FIXED
1. Introduction to LOD Expressions and FIXED
Welcome back! I'm Maarten, and I'll be your guide in the next videos. In this chapter, we'll master the navigation between various levels of data granularity with Tableau's Level of Detail Expressions.2. Granularity of the data
Before we dive into this topic, let's first discuss data granularity. Data granularity is the level of detail in a model or decision making process. It tells you how detailed your data is. Let's have a look at the following example. One table represents "Sleep per day" and another one "Heart Rate per minute". Can you guess which one has a higher data granularity? That's right, the right one!3. Granularity of the view
Granularity and Aggregation go hand in hand. When we aggregate the data, we take multiple values and present them as a single value, so we decrease the level of detail. In below table, the total sum of sales of 268K in all regions and years, is a high-level aggregation. When we however add dimensions to the table, such as Region and Years, we increase the data granularity and increase the number of data points in our view.4. Managing granularity in Tableau worksheet
In Tableau, the granularity increases with the amount of dimensions exposed in Rows and Columns or in the Marks, such as detail, color, shape and so on. The more dimensions we use, the higher the granularity and data points we get, but with more dimensions, it becomes more difficult to visualize our data in a clear and structured way.5. LOD Expressions in Tableau
Enter LOD expressions - Tableau's elegant and powerful way to easily compute aggregations that are not at the level of detail of the visualization. There are 3 functions in this family: INCLUDE, EXCLUDE, and FIXED. Through these functions you control the level of detail at which a calculation is performed and do not depend on dimensions used in the visualization. We will first look at the FIXED expression.6. FIXED LOD Expressions
FIXED LOD expressions compute a value using the specified dimensions, without reference to the dimensions in the view. The syntax is as follows: first, we open a pair of curly brackets, then we specify the LOD expression, FIXED, followed by dimensions, a colon, and an aggregation calculation. Note that you may use 0, 1, 2 or more dimensions, separated by a comma and in any order. The result of LOD expressions can either be a dimension or a measure. To recap, FIXED contains the dimensions of interest in the calculation so that our visualization can be simple and neat.7. Practical applications of FIXED LOD expressions
There are many practical applications of FIXED LOD expressions! One of them is calculating measures between various time dimensions, so for example swapping between daily and weekly sums of Sales. Another frequent application is calculating totals and subtotals per categories and percentages of total or contribution rates. Yet another use case is computing the first or last data point per subject, for example first order date per customer. But these aren't by far the only applications.8. Cohort and survival analysis
Let's have a closer look at two interesting analyses possible thanks to FIXED LOD expressions. Cohort analysis is one of them. Let’s imagine that we introduced a new feature of a product to a group of clients. We would like to follow up on how this group, in other words ‘cohort’, uses the product over time and compare it to another cohort - for example clients with no access to the feature. Another one is survival analysis. We all have good intentions on Jan 1st, but do we still stick with our New Year's resolutions in February? Survival rate allows us to calculate just that!9. Cohort and Survival analysis - FIXED
In each of these analyses, we need to anchor the user's behavior to a certain point in time. FIXED LOD expressions make it possible.10. Let's practice!
Let's see FIXED LOD expressions together in practice!Create Your Free Account
or
By continuing, you accept our Terms of Use, our Privacy Policy and that your data is stored in the USA.