3 Replies Latest reply on Feb 5, 2019 1:35 PM by Jonathan Drummey

    Sort with Grand Total

    Kristy Hyde

      Hi,

       

      I'm working in Tableau 10.4

       

      I have 2 dimensions (Category; Topic). I have a count on how many times a particular topic is mentioned by month for each "Category".

       

      The month field is discrete.

       

       

      I used the Totals--> Show Row Grand Totals under the Analysis tab. 

       

      I cannot figure out how to get the grand total to sort descending for each category.  I've tried creating a calculated field "Index ()" among other things, but haven't had any luck.

       

      Any assistance is much appreciated.

       

      Thank you,

      Kristy

        • 1. Re: Sort with Grand Total
          Jonathan Drummey

          Hi Kristy,

           

          It's sounding like you want a nested sort of Topic within each Category based on the total mentions, is that correct?

           

          If so there are a few ways to do this, here's a point & click version:

           

          1) In the Dimensions window select the Category and Topic dimensions, then right-click and choose Create->Combined field. A new Category & Topic field will be created in the Dimensions window.

          2) Drag the combined field to Rows between the existing Category and Topic pills.

          3) Right-click on the combined field and choose Sort... The Sort window will appear.

          4) Set up the sort options to use the total mentions measure, in descending order. This will sort each Category & Topic combination based on the total mentions at the Category & Topic level (i.e. what we see in the Total column). Tableau sorts the layout of the values of pills Columns and Rows based on the pill arrangement from left to right, so now the view will be sorted on Category, then the combined Category & Topic (which gets the nested sort), then the Topic pill won't do anything because it's already sorted by the prior combined pill.

           

          Hope this helps!

           

          Jonathan

          • 2. Re: Sort with Grand Total
            Kristy Hyde

            Hi Jonathan,

             

            This helps a lot.  It took me a couple tries to follow step 4, but I was successful.

             

            Thank you for your assistance. It is much appreciated.

            Kristy

            • 3. Re: Sort with Grand Total
              Jonathan Drummey

              You're welcome!