From the course: Tableau Certified Data Analyst Cert Prep
How to apply quick table calculations - Tableau Tutorial
From the course: Tableau Certified Data Analyst Cert Prep
How to apply quick table calculations
- [Instructor] We have already learned about many different calculation functions in the previous chapters, but there are also calculations that you don't necessarily have to write yourself: table calculations. Table calculations do not send a query to the database. Instead, Tableau uses the table of query results that we already got back from the database and puts another calculation on top of it. Table calculations are always based on aggregated measures. They add another aggregation level on top of the existing aggregation. For example, the running total is often a sum of the sums. It's important to know that table calculations always depend on the visualization level, meaning the level of detail in our view. In the coming videos, we will encounter both quick table calculations and custom table calculations. Let's start by checking out a simple quick table calculation. In this chart, I am showing the sum of total price per category per month and year of date of purchase. It's interesting to see the progression here, but actually we are interested in the cumulative sales. Which category has had the steepest increase in sales since the start of our business? So we are interested in the running total. Let's think about it for a second. What do we want to calculate the running total on? We are interested in the running total of our sales, so the sum of total price. So in the rows container, we go to the sum of total price. In the context menu, we find quick table calculations, quite far down in the menu, and you can see that there are many different quick table calculations we could choose and we will encounter them in the following videos. For now, let's simply select the running total. What changes now? The sales curve shows different values. You can now see that the last value is much higher than before because it is cumulative. We can also see that the axis shows a different scale to be able to display the now much higher values. The axis also has a different label, running sum of total price. We can also see a small triangle or delta at the green pill sum of total price in the rows container. With this, Tableau indicates that we are using a table calculation here. We don't know exactly which table calculation, but we see that we no longer just use the values that the database gives us, but we add an aggregation on top. You can simply return to the original value in the context menu by choosing to clear the table calculation. Then the triangle disappears, the line returns to its previous values, and the axis also looks normal again. Let me show you what other table calculations you can use in the following videos.
Practice while you learn with exercise files
Download the files the instructor uses to teach the course. Follow along and learn by watching, listening and practicing.