KNOWLEDGE BASE

Conditional Viz in Tooltip


Published: 29 Nov 2018
Last Modified Date: 30 Nov 2018

Issue

Cannot display a conditional viz in tooltip when hovering over different dimension members.

Environment

  • Tableau Desktop 10.5 and later

Resolution

The ability to implement conditional viz in tooltip is currently not built into the product.

As a workaround follow the steps below 

The instructions are demonstrated in the attached workbook, which is using the Sample - Superstore data source. In this workbook, the viz in tooltip depends on "Segment".
  1. Create 3 sheets called "Tooltip For Consumer""Tooltip For Corporate" and "Tooltip For Home Office".
  2. Click Analysis > Create Calculated Field.
  3. Create a calculated field named "For Tooltip" with the following formula:
    IF [Segment]="Consumer" THEN '<Sheet name="Tooltip For Consumer" maxwidth="300" maxheight="300" filter="<All Fields>">'
    ELSEIF [Segment]="Corporate" THEN '<Sheet name="Tooltip For Corporate" maxwidth="300" maxheight="300" filter="<All Fields>">'
    ELSE '<Sheet name="Tooltip For Home Office" maxwidth="300" maxheight="300" filter="<All Fields>">'END
  4. Open a new sheet and name it "Source Sheet" and place Sales on columns, "Category" and "Segment" on rows, and "For Tooltip" on the Details mark.
  5. On the Marks card, click Tooltip.
  6. In the edit tooltip window, click Insert > "For Tooltip".
  7. Again, click Insert > Sheets > "Tooltip For Consumer". Repeat this step for "Tooltip For Corporate" and "Tooltip For Home Office".
  8. Change maxwidth and maxheight to 1 for all the inserted tooltip sheets.
Now you can see a different viz in tooltip for each segment and the viz in tooltip is filtered by the selected "Segment".

Cause

The ability to implement conditional viz in tooltip is currently not built into the product.

Additional Information

The filtering viz in tooltip is triggered by a tooltip action filter, which is automatically generated for the sheet used in tooltip when hovering over a mark. A tooltip filter is added by inserting a sheet but not a calculated field in the tooltip. To generate tooltip filters, inserting all sheets used as viz in tooltip is required, but they can be hidden by setting 1 for the maxwidth and maxheight tags.

For more details, see the Next level Viz in Tooltip session from the Tableau Conference 2018. (The technique is introduced at 33:30).
Did this article resolve the issue?