4 Replies Latest reply on Nov 3, 2017 6:16 AM by Sushmitha Reddy

    How to create a Map with RANK calculated fields

    Keith Bowden

      Hello.  I am trying to make a Map based off of calculated fields that use the RANK function.  I have one view, which is a table, that displays my data properly (various categories, with their corresponding calculated fields, that use RANK and then a Total Rank that uses RANK on a summation of the various other RANK categories).  When I try to convert this to a Map, however, the calculated fields all return a value of 1 in the Text shelf.  Is there a way I can provide the right data in the Level Of Detail (or some other way?) to have the RANK calculated fields show properly (rankings of 1 - 531 for "Rank - Total" in this example)?  I have attached my workbook with the Sample - Superstore data, and I'm using Tableau Desktop Professional Edition 10.3.4.

       

      Thank you!

       

      -Keith

      Screen Shot 2017-10-30 at 1.25.11 PM.png

       

      Screen Shot 2017-10-30 at 1.25.15 PM.png

        • 1. Re: How to create a Map with RANK calculated fields
          Sushmitha Reddy

          Hi Keith,

           

          Setting your table calculations to compute using 'City' will help resolve the problem.

          Also, remove Country and State from the Detail, to match the ranks you have computed in the sheet -'Table'

          Let me know if you have any question. I have attached the workbook with the solution too.

          1 of 1 people found this helpful
          • 3. Re: How to create a Map with RANK calculated fields
            Keith Bowden

            PS.  I am trying to accomplish the same thing with client-specific data (so I cannot share it here) at a more detailed and complex level... I am showing in a table different locations ranked (keep in mind locations belong to specific markets...  New York has locations 1, 2, 3.  California has locations 7,8,9, etc.).  Essentially I have 7 different RANK calculated fields (rankings on 7 different metrics), 1 calculated field that adds up each of the 7 RANKS ("Total Score"), and then a "Rank - Overall" calculated field that ranks "Total Score".  When I edit the table calculation for "Rank - Overall" in my table view 8/9 Nested Calculations are computed using "Table (down)".  One is computed using specific dimensions based on how it calculates (Market level, and then location, restarting every market).  These calculations and results are accurate.

             

            For the map view, I have brought in Location and Market pills into the Level of Detail.  I also have Location in the Label, along with "Rank - Overall" in the label.  When I hover over a location, the tooltip is showing "Rank - Overall" as 1 for each location... it's not showing the score that each location has in the table view.  If I try changing "Rank - Overall" to Compute Using Location or Market instead, the values stay the same ("1").  Also, there is not the "Table (down)" option anymore, but there is a "Table (across)" option...

             

            Any ideas?  Thanks!

            • 4. Re: How to create a Map with RANK calculated fields
              Sushmitha Reddy

              Hi Keith,

               

              When computing Rank along table- down is , nothing but, it is computing using City (because the list of cities are in a column from top to down). In this case when you change Compute using to City, there wouldn't be any change of Ranks.

              Since we don't have the option to compute using table(down) in map, I have set that to compute using City.

               

              If a dimension that is at an other level of detail than the City is added to the sheet, the table calculation is computed taking the new dimension also into account.

              The same thing happens when location is added to the sheet with the Map. To avoid this problem, you can warp the calculation in LOD expressions. But, LOD expressions can't be computed using Table calculations (like Rank).

               

              My final answer is - we can't add Location to the Map to show them in Labels. And apologies for my delayed response.