2 Replies Latest reply on Apr 10, 2018 1:18 PM by Becky Lehotzky

    Dynamic tooltips/Filtering top N by year

    Becky Lehotzky

      Hello,

       

      I've hit a couple different walls in my project - each seems pretty

      straightforward, but I'm very much a Tableau newbie. I'm using SSA data

      from 1880-2016 to look at the relative popularity of the most popular baby

      names over time. I have a line graph showing this for the most popular name

      each year (by changing the measure for my relative popularity calculated

      fields from SUM to MAX), but that's where I run into my first problem:

       

      1.) I've been unable to get the actual name that was most popular each year

      to show up in the tooltip. When I add , I just get a static tooltip

      saying the same. Do I need a calculated field that somehow connects the

      relative popularity of each name with the actual name? If so, what would

      that look like?

       

      2.) My next roadblock has been in trying to build a similar visualization,

      but showing the combined relative popularity of the top 10 names from each

      year, rather than just each year's top name. Any time I've tried adding a

      filter or rank, it just ends up applied by year (i.e. only showing the 10

      most recent years) or name (the top 10 names alphabetically).

       

      Thanks in advance for any suggestions,

       

      Becky

       

        • 1. Re: Dynamic tooltips/Filtering top N by year
          Jason McCann

          Hey Becky,

          Since it looks like you're using Tableau 10.5 you could take advantage of the viz within a tooltip to achieve both of your questions.  Check out this article for how to retrieve top N names by year

           

          Finding the Top N Within a Category | Tableau Software

           

          Then you could just add that "Top 10" sheet into your tooltip and filter on year

           

          <Sheet name="Top 10" maxwidth="300" maxheight="300" filter="<YEAR(Year of Birth)>">

          • 2. Re: Dynamic tooltips/Filtering top N by year
            Becky Lehotzky

            Thanks so much for the response - I've tried to filter for the top 10 using the INDEX option in linked article, but the output was this:

            (I had a similar result when I swapped the items in Columns and Rows to be more consistent with the example in the article.)

             

            I've tried the RANK option, but I get an error when I try to enter the calculated field, since Tableau requires aggregated values when more than one data source is used (my data come from a txt file and an Excel file). This may still be an option if I can find some shortcuts that would make it more feasible to merge the two documents into one source.