KNOWLEDGE BASE

Listing All Members Of a Dimension in a Tooltip


Published: 19 May 2016
Last Modified Date: 07 Aug 2017

Question

How to list all members of a dimension in a tooltip, for example the list of sub-categories per category. 

Environment

Tableau Desktop

Answer

The following steps are demonstrated in the attached workbook called Dimension in Tooltip.tbwx with the Superstore sample data source.

Step 1: Create the calculated fields

  1. In Tableau Desktop, click Analysis > Create calculated field.
  2. Name it Last Sub-Category per Category and set the following calculation, then click OK.
    LOOKUP(MIN([Category]),1 )!=MIN([Category]) OR LAST()=0
    
  3. Create another calculate field by selecting Analysis > Create calculated field
  4. Name it as List of Sub-Category and enter the following formula:
    IF FIRST()==0 THEN 
    MIN([Sub-Category])
    ELSE
    PREVIOUS_VALUE("")+ "," + MIN([Sub-Category])
    END

Step 2: Build the view 

  1. Drag "Category" and "Sub-Category" to Rows.
  2. Drag "Sales" to Columns.
  3. Drag "Last Sub-Category per Category" to Filters and select True.
  4. Drag "List of Sub-Category" to Tooltip
  5. Drag "Number of Records" to Text.
  6. Right click "List of Sub-Category" in Tooltip and select Edit Table Calculation.
    1. Select Specific Dimensions 
    2. Uncheck Category.
  7. Right click "SUM(Number of Records)" in Text and select Quick Table Calculation > Running Total.
  8. Right click SUM(Number of Records) in Text and select Edit Table Calculation.
    1. Select Specific Dimensions
    2. Uncheck Category.
  9. On Row, right-click "Sub-Category" and uncheck Show Header.
If you hover on the number of records, the list of sub-categories is displayed.
Did this article resolve the issue?