Tableau: Apply Table Calc Filters

In Tableau, table calculations are used to calculate the values and fields within a view. In other words, table calculations depend on the data present in the worksheet's view for their computations. For example, if a bar chart shows four categories, we can perform calculations based on the values represented by the bars. However, when elements are removed from the view, the calculations may not function correctly. Therefore, they represent the lowest level of filtering in Tableau's order of operations. RANK(), Running Sum() , Lookup() , WINDOW_AVG () are some of the popular expressions used for table calculation. We can also apply table calculations as a filter in a worksheet to dynamically control the visualization and highlight specific data insights based on the computed results.

In this blog, I will demonstrate how we can apply table calc filters based on a scenario.  We will be using Sample Superstore dataset for this purpose.

Scenario

What are the top 10 states in the USA based on high profit?

Step 1: Drag 'State/Region' to the row shelf and 'Profit' to the column shelf. A horizontal bar chart is created as shown in the figure below.

Step 2: Create a rank for each state based on profit values. Right-click on the 'Profit' field on the data pane, click on 'Create', and then on ' Calculated Field...).

Step 3: A calculation window will appear. Create a calculation 'RANK(SUM([Profit]))' and name it 'Rank for Profit' as shown in the figure below. Then, click 'Ok'

Step 4: Drag the 'Rank of Profit' table calculation field to the filter shelf. A filter window will appear. In the 'Range of values' section, assign the minimum value as 1 and the maximum as 2. Click 'Ok'.

As a result, the table calculation filter using RANK (table calc) presents the following list of the top 10 most profitable states in the USA. These states are ranked based on their high-profit values.

Author:
Nitesh Shrestha
Powered by The Information Lab
1st Floor, 25 Watling Street, London, EC4M 9BR
Subscribe
to our Newsletter
Get the lastest news about The Data School and application tips
Subscribe now
© 2024 The Information Lab