htt

Software & Programme

Extending Tooltip Info in Tableau

von
tooltip-info-tableau-us20-9-result

I was looking for a way to present more information in Tableau Tooltips and remembered seeing a way to include bar charts in Tooltips. I eventually found the article I remembered here but I found it rather fiddly to add the 100 character strings and also I ended up with many out of range results i.e. results that were either over 100 or minus values.

After a few attempts here is what I finally ended up with that seemed to give me what I was after:

tooltip-info-tableau-us20-1

And so it looks like in practice:


Here is what I did. First create the Profit Ratio of course:

tooltip-info-tableau-us20-2-profit-ratio

Then we can use the SPACE and REPLACE functions of Tableau to create a string to the exact length of the calculated Profit Ratio.

First I need the Profit Ratio as number rather than Percentage rounded to 2 decimal places:

tooltip-info-tableau-us20-3-profit-ratio

Then I can use this to fill a string with the appropriate number of spaces:

tooltip-info-tableau-us20-4-profit-ratio

I can then replace the spaces with more useful characters. The extended ASCII character set is useful for this. To access this character set just hold down alt and type the number on the numeric keypad. You can find a list of the characters here. I will use the 219 character █.

tooltip-info-tableau-us20-5-profit-ratio

Ok, now we have a dynamic length of bar but how to deal with positive or negative numbers.

I used two calculated fields for this. The one I created above named and modified like so:

tooltip-info-tableau-us20-5-bars

This gives us our positive bars. For the negative I created the following:

tooltip-info-tableau-us20-6-negativ-bars

I also used WINDOW_SUM to create the same but for the next row in order give some contrasting values for testing.

Now we have to values that are exclusive to each other, when one appears the other one doesn’t. Therefore we can use both in the tooltip with colour formatting to differentiate positive and negative like so:

 tooltip-info-tableau-us20-7
Result

tooltip-info-tableau-us20-8-result



Lösungen, die eine fundierte Entscheidungsfindung sicherstellen?

Informationen für Ihr Unternehmen, die qualitätsgesichert, entscheidungsrelevant sind und anspruchsvolle Geschäftsanalysen bieten? Gerne unterstützen wir Sie hierbei und stehen Ihnen für eine individuelle Fragen zur Seite. Tel.: +49 (0) 70 31 714-6215 oder per Kontaktformular


Richard Raistrick

Über den Autor 

BA-Universität Sheffield. 12 Jahre Erfahrung als Enterprise Software Technical Consultant/Ingenieur bei einem der weltweit größten Softwareunternehmen. Seit Anfang 2014 bei der Insight Dimension GmbH als Consultant / Entwickler tätig.

Extending Tooltip Info in Tableau Reviewed by on .

I was looking for a way to present more information in Tableau Tooltips and remembered seeing a way to include bar charts in Tooltips. I eventually found the article I remembered here but I found it rather fiddly to add the 100 character strings and also I ended up with many out of range results

Hinterlasse einen Kommentar

Your email address will not be published. Required fields are marked ( required )