3 Replies Latest reply on May 27, 2014 7:42 AM by Vaishali Kumar

    sorting based on ranks

    Sidharth Dash

      Dear Tableau community,


      I am stuck up with something related to soring based on ranks. In the attached workbook ( refer to the sheet with bar chart ), I am trying to sort Customer segment with their rank. I have a dynamic measure of sales/profit which should change as per the parameter selection. This is working fine but the sorting.

      i want that the bars to be sorted with descending rank no matter what dimensions i keep adding to columns shelf.


      Please let me know if you need further clarity into this.




        • 1. Re: sorting based on ranks
          Vaishali Kumar

          Hi sidharth,


          Here is the solution for you in the attached workbook.



          -You would have to create a combined filed using three dimensions placed in your Coulumn shelf i.e. "Order priority", YEAR(Order Date)" & Customer segment

          -Place the newly created Combined field on the third no. in the column shelf just before your Customer Segment filed.

          -Uncheck the header for Combined filed & reducing a "Level" under column divider formating option to bring your view in original shape

          -Sort Combined field on "Dynamic Measure" Field(DescendingOrder) Created by you.


          And its done!


          Now, sorting will always be based on your dynamic measure Field even if you change selections in any of your quick filters or parameters.

          Hope this is what you were looking for!!


          Let me know in case of any confusion.



          • 2. Re: sorting based on ranks
            Sidharth Dash

            Hey Vaishali,


            Much thanks for picking this up. I tried concatenating the fields (another calculated field with all the three fields being concatenated) and don’t know why that dint work. I guess I had missed a thing or two. That is the same of what you have done but an alternate.. that should also work right?


            So what I conclude is that if I have to add any further dimension over column shelf, that field should also be part of the combined field..?




            • 3. Re: sorting based on ranks
              Vaishali Kumar

              Yes you are right Sidharh, if you have 3 fields in coloumn shelf and you want to sort your data values within that partition then you have to create a combined field including all the dimensions in that partition(in your case its 3 dimensions).


              If you increase no. of dimesion in your column shelf and you want to sort your data values within that partion then you would have to add another field to your combined field.


              Hope it helps!!