2 Replies Latest reply on Mar 23, 2015 6:55 AM by Adam Price

    Have Tableau show the most popular category in each state?

    Adam Price

      Hi-

       

      I am working with data that shows the number of enrollees into Medicare Advantage plans in each state and county, and would like to create a filled map that shows only the most popular plan type (the one with the most enrolled) for each state.  I am able to generate a map with a pie chart overlaying it that breaks down the number of all enrollees in each plan for that state, but would like to tease out only the plan type with the largest enrolled. 

       

      Ultimately, I would like be able to compare between states as to which plan is most popular between, and then add years to the pages shelf to see how this changes over time.  I have attached my packaged workbook.

       

      Any tips would be greatly appreciated.  Thank you. 

        • 1. Re: Have Tableau show the most popular category in each state?
          Mary Solbrig

          Relevant article: Finding the Top N Within a Category | Tableau Software

           

          Steps to apply:

          1. From a new sheet, drag State and Plan Type to the Rows shelf and Enrolled to the Columns shelf

          2. Select Analysis > Create Calculated Field

          3. In Name enter Rank and in Formula enter RANK(SUM(Enrolled))

          4. Select OK

          5. Right-click on Rank and select Convert to Discrete

          6. Drag Rank to the Rows shelf in between State and Plan Type

          7. Right-click on Rank and select Edit Table Calculation

          8. Select Compute Using > Advanced

          9. Move State to the Partitioning pane and Plan Type to the Addressing pane and select OK

          10. Verify that this ranking really is what you want. I believe it is.

          11. Drag the Rank field from the Rows shelf to the Filters shelf

          12. Check only the box that says "1" and select OK

           

          Now, to create a map that does this (I just thought the steps made more sense as a bar chart)

          1. From a new sheet, Double-click on State

          2. Drag Plan Type to the Details shelf

          3. Drag Rank to the Filters shelf and select OK to ignore the filters option dialogue that appears

          4. Right-click on Rank and select Edit Table Calculation

          5. Select Compute Using > Advanced

          6. Move State to the Partitioning pane and Plan Type to the Addressing pane and select OK

          7. New filter dialogue will appear. Check only the box that says "1" and select OK

          • 2. Re: Have Tableau show the most popular category in each state?
            Adam Price

            Fantastic! Thank you Mary for all your help!