Tableau, tool tips, work book,

download Tableau, tool tips, work book,

of 3

Transcript of Tableau, tool tips, work book,

  • 8/10/2019 Tableau, tool tips, work book,

    1/3

    CHARTS INSIDE A TOOLTIP? YES, WE

    CAN.SEPTEMBER 29, 2010ADMIN12 COMMENTS

    1

    [Update: in theory, v6.1.1 has made it easier to create the bars described in this post by

    using REPLACE() and SPACE(). However, at time of writing (19 Aug 2011) there is a

    problem: while the solution works fine in Tableau Desktop, the view wontdisplay on

    Tableau Public have a look at the UsingREPLACE and SPACE() tab in the embedded

    workbook below. The calculations have also been optimised using parameters.]

    Consider this map:

    It highlights one of many situations when pie charts dont work. The smallest pies are so smallyou have no chance of making out the size of the slices. And what if I wanted to show Profits on

    the viz, as well as Sales and Product Type?

    http://gravyanecdote.com/andy-cotgreave/charts-in-a-tooltip/http://gravyanecdote.com/author/admin/http://gravyanecdote.com/andy-cotgreave/charts-in-a-tooltip/#commentshttp://gravyanecdote.com/andy-cotgreave/charts-in-a-tooltip/http://gravyanecdote.com/andy-cotgreave/charts-in-a-tooltip/http://interworks.co.uk/wp-content/uploads/2010/09/Pie_Problem.pnghttp://gravyanecdote.com/andy-cotgreave/charts-in-a-tooltip/http://gravyanecdote.com/andy-cotgreave/charts-in-a-tooltip/#commentshttp://gravyanecdote.com/author/admin/http://gravyanecdote.com/andy-cotgreave/charts-in-a-tooltip/
  • 8/10/2019 Tableau, tool tips, work book,

    2/3

    The Tableau guys have come up with a way of using Gantt Bars to emulate a bar chart and

    maybe solve some of these problems.This works okay, but has its own flaws; mainly that itsstill hard to make out the individual bar segments.

    Well, how about using a bar chart insidea tooltip? Surely you cant do that? Well, yes you can:

    Powered by Tableau

    The viz above solves several problems. The circle size is based on Sales, and Profit by colour.

    And the tooltip shows the proportion of sales of each Product Type. With just a mouse-hover,

    youve revealed a new dimension on the data. Three dimensions on one map viz bingo!

    How do we do this? Well, first we need to decide if our dataset is suitable. First of all, you need a

    known number of values in your tooltip-chart dimension, because well be creating a calculated

    field each one. In the above, we only have four Product Types, so thats a suitable candidate.Secondly, there is a maximum length that the bar can be. Too long and it will wrap around in the

    tooltip. As well see, the bar is built using a text string, so we cant just have an unlimited barwith a value in the 100s. Percentages work best as they are going to have a maximum value of

    100.

    For each Product Type, we need two calculated fields. One works out the percentage of sales of

    that product type:

    and the other works out the length of the bar. How do you build a bar out of text? Simple: use the

    ALT+219 ASCII character. Thats this one: . You create it by pressing the ALT key and then219 on the Number Pad (using a laptop? Copy and paste the one in this blog instead!). We need

    to create a parameter[Bar]which is one loooong string of 100 characters, and then create acalculated field that is a subset of that, based upon the % value in your other calculated field.

    Heres the text of that field:

    http://www.tableausoftware.com/public/blog/2010/09/bar-charts-maphttp://www.tableausoftware.com/public/blog/2010/09/bar-charts-maphttp://www.tableausoftware.com/public/blog/2010/09/bar-charts-maphttp://www.tableausoftware.com/public?ref=http://public.tableausoftware.com/views/Tooltipcharts/Tooltipchartshttp://www.tableausoftware.com/public?ref=http://public.tableausoftware.com/views/Tooltipcharts/Tooltipchartshttp://www.tableausoftware.com/public?ref=http://public.tableausoftware.com/views/Tooltipcharts/Tooltipchartshttp://www.tableausoftware.com/public/blog/2010/09/bar-charts-maphttp://www.tableausoftware.com/public/blog/2010/09/bar-charts-map
  • 8/10/2019 Tableau, tool tips, work book,

    3/3

    LEFT([Bar],ROUND([% coffee sales]))

    Now we have two calculated fields for each Product Type. Drop them all onto the ever-so-useful

    Level of Detail shelf, and now you can build your tooltip as follows:

    Youve done it! Youve now become a tooltip genius. Using the skills weve learned in our othertooltip posts (basics here, andconditional formattinghere), your tooltips can be as jazzy as your

    vizzes themselves!

    Those of you who are big Excel users may know where the inspiration comes from. This post

    gives a huge Tip o The Hat to the posts fromJuice Analytics,Daily Dose of Excel,Jon Peltier,andChandoo that showed us all how to do in-cell charts in Excel in the last few years. Also,

    thanks toRichard Leeke on the Tableau forumfor giving me the last piece in the jigsaw for this

    idea: Excel has a REPT function that can be used to create the long string. Tableau doesnt.Richard pointed out that the only way round this is to type the string out manually and take a

    substring of it. Nice!

    http://interworks.co.uk/blog/the-data-studio-blog/andy-cotgreave/tooltip-tips-pt-1http://interworks.co.uk/blog/the-data-studio-blog/andy-cotgreave/tooltip-tips-pt-1http://interworks.co.uk/blog/the-data-studio-blog/andy-cotgreave/tableau-tooltips-conditional-formattinghttp://interworks.co.uk/blog/the-data-studio-blog/andy-cotgreave/tableau-tooltips-conditional-formattinghttp://interworks.co.uk/blog/the-data-studio-blog/andy-cotgreave/tableau-tooltips-conditional-formattinghttp://www.juiceanalytics.com/writing/more-on-excel-in-cell-graphing/http://www.juiceanalytics.com/writing/more-on-excel-in-cell-graphing/http://www.juiceanalytics.com/writing/more-on-excel-in-cell-graphing/http://www.dailydoseofexcel.com/archives/2006/02/05/in-cell-charting/http://www.dailydoseofexcel.com/archives/2006/02/05/in-cell-charting/http://www.dailydoseofexcel.com/archives/2006/02/05/in-cell-charting/http://peltiertech.com/Excel/Charts/InCellFormulaCharts.htmlhttp://peltiertech.com/Excel/Charts/InCellFormulaCharts.htmlhttp://peltiertech.com/Excel/Charts/InCellFormulaCharts.htmlhttp://chandoo.org/wp/tag/in-cell-charting/http://chandoo.org/wp/tag/in-cell-charting/http://chandoo.org/wp/tag/in-cell-charting/http://chandoo.org/wp/tag/in-cell-charting/http://chandoo.org/wp/tag/in-cell-charting/http://interworks.co.uk/wp-content/uploads/2010/09/tooltip_text.pnghttp://chandoo.org/wp/tag/in-cell-charting/http://chandoo.org/wp/tag/in-cell-charting/http://peltiertech.com/Excel/Charts/InCellFormulaCharts.htmlhttp://www.dailydoseofexcel.com/archives/2006/02/05/in-cell-charting/http://www.juiceanalytics.com/writing/more-on-excel-in-cell-graphing/http://interworks.co.uk/blog/the-data-studio-blog/andy-cotgreave/tableau-tooltips-conditional-formattinghttp://interworks.co.uk/blog/the-data-studio-blog/andy-cotgreave/tooltip-tips-pt-1