3 Replies Latest reply on Oct 3, 2016 2:50 PM by Jenny Sanders

    Dynamic Sorting on multiple measures

    Jenny Sanders

      Hi

      I am trying to sort on a calculated field that is a measure by other measure columns. I have "Company" field which is a dimension and I am calculating the top 15 "Comapny" based on Index value calculated field . The calculated field " Indicator Value" gives the top 15 "Options" and the rest as "Others".

       

      I want to sort the "Indicator Value" based on different measure values like Active weight, TE, TE% and Beta.  My original requirement is to be able to sort the "Indicator Value " based on other measures. But not able to do so as it's showing me only "Sort by Data Source Order" or "Manual". I am not able to see the "sort by field option". I think it's because it's a measure.

       

      I came across this post http://reports4u.co.uk/tableau-dynamic-sorting/  and thought of  a possible work around.

       

      I created two parameters as "Sort by" which contains Te, Te% etc.and Sort Order " and then linked them to the calculated field " Sort by Field"  which would sort all the measures. Instead of sorting on "Indicator Value" , I tried to apply this dynamic sorting on to "Company" pill as "Company" and "Indicator Value" give the same results. While sorting on company pill also I was not able to see the " Sorts by Field" calculated field as option.

       

      All the measures are table calculations. I don't know if that's what causing this issue.

       

      Here is the attached screenshot of what I am exactly seeing and trying to do.

       

      Any helps would be greatly appreciated ! I stuck and don't know how to make this work.

       

      Thanks !

        • 1. Re: Dynamic Sorting on multiple measures
          Brad Shuel

          Hi Jenny,

           

          A specific answer may depend on the structure of the data source and view. Are you able to share the workbook or a workbook with sample data with a similar structure?

          • 2. Re: Dynamic Sorting on multiple measures
            Brad Shuel

            Hi Jenny,

             

            I'm not sure if I fully understand the question and I couldn't find the example workbook. With that said, we might be able to use Rank. See the steps below.

             

            1. Create a calculated field with the formula Rank(Sum([Measure]))

            2. Drag the rank field to the Rows (or Columns shelf).

            3. Right-click on the Rank field on the Rows/Columns shelf > Discrete

            4. Drag the Rank field to the far left of the dimension to sort on the Rows/Columns shelf.

            5. Right-click on the Rank field on the Rows/Columns shelf > de-select 'Show Header'

             

            Hope it helps. If it doesn't, try to upload the sample workbook again.

            • 3. Re: Dynamic Sorting on multiple measures
              Jenny Sanders

              Hi Brad,

               

              Thanks for replying back. I got busy in some other work. Please see the attached sample workbook with my attempt so far. Is there any possible way to do this sorting dynamically like without the user have to change the parameters. Because that's what my requirement is as the data source is an excel file and data gets updated every month. So every time it gets updated , I want everything to sort dynamically on any particular "Sort_By" field.