KNOWLEDGE BASE

Hiding Columns without Filtering Underlying Data


Published: 23 Oct 2014
Last Modified Date: 20 Sep 2016

Question

How to hide some columns without changing the results of table calculations. In this specific example, only the most recent column will be displayed when creating a percentage of difference calculation.

Environment

Tableau Desktop

 

Answer

To hide specific columns without filtering the underlying data, we can filter on LAST(), INDEX(), FIRST(), or RANK() and use table calculations to display the correct values. The below example uses the Sample - Superstore data source.

Step One - Create a Calculated Field with LAST()

  1. Select Analysis Create Calculated Field to create a calculated field.
  2. In the Calculated Field dialog box that opens, type a name for the field. In this example, the field is named [Last].
  3. Type the following into the Formula field, and then click OK: LAST()

Step Two - Create Current Date Filter

  1. Select Analysis Create Calculated Field to create a calculated field.
  2. In the Calculated Field dialog box that opens, type a name for the field. In this example, the field is named [Current Date Filter].
  3. Type the following into the Formula field, and then click OK: If [Last] = 0 THEN 1 ELSE 0 END

Step Three - Create the View

  1. Drag [Order Date] to Columns.
  2. Drag  [Category] to Rows.
  3. Place [Last] on Detail.
  4. Place [Sales] on Text.
  5. Right-click SUM(Sales) on the Marks card and select Quick Table Calculation > Percent Difference
  6. Drag [Current Day Filter] to the Filter shelf.
  7. In the Filter dialog box that opens, select a range of 1-1.

Additional Information

To view these steps in action, see the video below: 

 
Did this article resolve the issue?