Overview of table calculations

Table calculations are different from all other calculations in Tableau. Row-Level, Aggregate calculations and LoD expressions, which we considered in the previous chapter, are performed at the data-source layer. If you were to examine the queries sent to the data source by Tableau, you'd find the code for your calculations translated into whatever flavor of SQL the data source used.

Table calculations, on the other hand, are performed after the initial query. Here's an extended diagram, which shows how aggregated results are stored in Tableau's cache:

Table calculations are performed on the aggregate table of data in Tableau's cache right before the data visualization is rendered. It's very important to understand this, for various reasons, including the following:

  • Aggregation: Table calculations operate on aggregate data. You cannot reference a field in a table calculation without referencing it as an aggregate.
  • Filtering: Regular filters will be applied prior to table calculations. This means that table calculations will only be applied to data returned from the source to the cache. You'll need to determine whether you have allowed all the data necessary for table calculations to work as desired.
  • Late filtering: Table calculations, used as filters, will be applied after the aggregate results are returned from the data source. The order becomes important. Row-level and aggregate filters are applied first, the aggregate data is returned to the cache, and then the table calculation is applied as a filter that effectively hides data from the view. This allows us to take some creative approaches to solve certain kinds of problems which we'll consider in some of the examples.
  • Performance: If you are using a live connection to connect to an enterprise database server, then row-level and aggregate-level calculations will be taking advantage of enterprise-level hardware. Table calculations are performed in the cache, which means that they will be performed on the machine that is running Tableau. Most often, you will not need to be concerned if your table calculations are operating on a dozen, or even hundreds of, rows of aggregate data. However, if you are getting back several hundred-thousand rows of aggregate data, then you'll need to consider the performance of your table calculations.
..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset