1 Reply Latest reply on Oct 22, 2015 7:14 AM by Simon Runc

    Ranking function in Tableau


      I have a problem using a rank function in Tableau, particularly displaying in a map. Here is what I wanted to do


      I have a map displayed using lat and long field. In the dataset, I have a field called "estimated values". Now, I wanted to use the rank function (RANK_UNIQUE) to get ranks of each row based on the magnitude of "estimated values" and display the ranked values in the map. For this, I created a new calculated field and used following code:


      RANK_UNIQUE(SUM([estimated values]),'desc')


      I'm getting two different results:

      1. When I display this in a map, instead of getting ranked values different for each row, all are one one one ...Not sure what is the reason behind this. This is my problem here


      2. However, when I simply use a bar chart to see the ranked values, they appear correctly.


      I would really appreciate if anyone can help me on this. Thanks in advance.

        • 1. Re: Ranking function in Tableau
          Simon Runc

          hi Lalita,


          So the Rank functions in Tableau are Table Calculations. This means they are not run (in the background on the data) but how it calculates is dependent on the Level of Detail of your Viz and how you set the Table Calculation to compute.


          If you right-click on your rank calculation pill (in your Viz), you can see what the 'Compute Using' is doing. When you bring a Table Calc into your Viz, Tableau guesses how you want to run it, but if it doesn't get it correct you can set how to run it here.


          So if, for example, the points/marks you want Ranked were Cities, by setting the Compute Using to cities, it should now Rank the Cities. If you have multiple dimensions in your view you may need to do some extra customization.


          If you try just changing the Compute Using to the Level of your marks, and see if that works, If not...can post an example of your workbook, and we should be able to get it working