Tableau lets you summarize data at different levels of aggregation. In this video, learn how to use level of detail expressions.
- [Instructor] One terrific Tableau capability is the level of detail expression. Most calculations happen at a specific level, such as the sheet level, table/row level, and so on. Level of detail expressions let you specify the level at which you want your calculation to occur. In this movie, I will show you how to define level detail of expressions and give an example of their use. My sample file is 04_05 LevelOfDetail and you can find it in the chapter four folder of the exercise files collection. I have visualized revenue data based on the order total field by quarter. So, I have quarterly revenue going from Q three of 2017 to Q three of 2019. But let's say that I don't want to display just the sum of the order total. Instead, I want to find the difference of each quarter's total sales from the average total sales. So in other words, it looks like the average might be somewhere around 700,000 or so. So I want to see the difference between a given quarter's sales and the average. To do that I need to compare two different levels of aggregation. The quarter level and then the overall quarterly average. To do that I need to create a level of detail expression, so I will drag sum of order total from the rows area off the visualization and then I will double-click on the row shelf to create my calculated field using a level of detail expression. It's easy to get level of detail expressions wrong, so I'm going to it wrong twice and then show you the right way to do it. So, the first way to get it wrong is to not specify that you're doing a level of detail expression. So, let's say that I want to subtract the average of quarterly sales from a specific quarter. I will type a left square bracket to indicate I want to work with a field and then the values are in the order total field. So, I'll type in O, go down to order total, and press tab to accept it. So, I have order total and I want to find it's difference from the average, so I'll type a minus sign, then AVG for the average function, then a left parenthesis, and then a left square bracket to indicate I want to work with a field, and again we're using order total, go down there. Press tab once it's highlighted, type right parenthesis, and enter, and I see that there is an error, and that no data has been displayed. Now, the problem is that I didn't specify order total which is the, essentially the table/row level here for each quarter versus the overall average. Those are two different levels of detail. So, I need to surround the AVG order total expression in curly brackets. So, I will double-click the pill and then around AVG order total I will first type a left curly bracket just left of the A and then after the last parenthesis I'll type a right curly bracket and enter, and my data looks nothing like it should. It's just a bunch of individual dots. And the problem is that you need to get it right the first time. You can't make an edit and expect the level of detail expression to come out correctly. So, I'll delete my current level of detail expression. So, I'll right-click the pill and then the very bottom item is remove. Then I'll double-click back on the row shelf, and type a left square bracket and then order total just as I did before, minus left curly bracket, then AVG, left parenthesis, left square bracket, order total again, right parenthesis to close the average functions expression, and then a right curly bracket to indicate that I'm using a level of detail expression, press enter, and there we have it. So, we have the difference from our average. If I want to retain the calculated field that I just made on the row shelf, I can drag its pill to the measure area. And then with the name highlighted, I can type diff from AVG, enter, and that is a new field that I have available to me in this workbook.
- Explain where a user would navigate to seek specific help in Tableau.
- Determine the best approach for using Excel in Tableau.
- Interpret how to use the features and functions of Tableau when creating charts.
- Describe how best to manage data in a worksheet or visualization.
- Explain how to create a selection filter for certain values.
- Explain how to manage data for different chart formats.
Skill Level Beginner
1. Introducing Tableau
2. Managing Data Sources and Visualizations
3. Managing Tableau Worksheets and Workbooks
4. Creating Custom Calculations and Fields
5. Analyzing Data
6. Sorting and Filtering Tableau Data
7. Defining Groups and Sets
8. Creating and Pivoting Crosstabs
9. Creating Basic Visualizations
10. Formatting Tableau Visualizations
11. Annotating and Formatting Visualizations
12. Mapping Geographic Data
13. Creating Dashboards and Actions
Next steps1m 17s
- Mark as unwatched
- Mark all as unwatched
Are you sure you want to mark all the videos in this course as unwatched?
This will not affect your course history, your reports, or your certificates of completion for this course.Cancel
Take notes with your new membership!
Type in the entry box, then click Enter to save your note.
1:30Press on any video thumbnail to jump immediately to the timecode shown.
Notes are saved with you account but can also be exported as plain text, MS Word, PDF, Google Doc, or Evernote.