7 Replies Latest reply on Aug 11, 2016 10:44 PM by Rajeev Pandey

    quick question

    Purvi Ajmera

      I have multiple dimensions across rows and I wanted to be able have sort functionally on each dimension but looks like it only works on the first one...."Opportunity Name"  Why is that?


        • 1. Re: quick question
          John Sobczak
          • ·In a text table, Sorting is first and foremost controlled by the dimensions in the header pane.  Records are first sorted to the highest most dimension (ie. farthest to the left on rows shelf) and so on for the second highest etc.


          • ·Data pane field sorting can only be done within the above context to dimensions in the header pane which means to the lowest level dimension in the header pane (dimension farthest to the right in rows shelf).


          • ·If you only have one dimension in your header pane then sorting can be purely done on any of the data pane fields independently.   One way to get only one dimension in your header field but also having information from multiple dimensions is to combine all needed dimensions into a single “flat” dimension.


          • 2. Re: quick question
            Rajeev Pandey

            Hi Purvi,

            Please follow the below approach

            You can easily sort your data by different dimensions when you use a parameter control. For example, you have several dimensions—Item, Category, Department, and Region—and you want to be able to select the dimension from a drop-down list by which to sort the data. To do this, complete the following tasks:

            1. Create a parameter with the dimension values you want to sort by and show the parameter control in the view.
            2. Create a calculated field used to perform the sort.
            3. Build the view.

            Create a Parameter Control to Sort by Dimension | Tableau Software


            • 3. Re: quick question
              Purvi Ajmera

              Thanks for your response Rajeev!


              So I created parameter and then calculated field but my formula is an error because I have date and $$ and String in dimensions.  Would I have to change the way I set parameter?  If I choose data type as Float - I'm not able to list dimensions.  Still learning tableau language....


              what am I doing wrong?  






              • 4. Re: quick question
                Rajeev Pandey

                Hi Purvi,

                The Problem is related to the Data type mismatch.


                Just try to understand.. when I defined the parameter, i have taken the data type as "String" and as per case statement what I am saying when 'Department' THEN [Department]. If you follow closely the data type , you will realize department is also a String type . I mean to say prefix "abc" is present in the starting of the Department. Similarly for other dimension.


                CASE [Sort By]


                WHEN 'Department' THEN [Department]


                WHEN 'Category' THEN [Category]


                WHEN 'Item' THEN [Item]


                WHEN 'Region' THEN [Region]




                But as per your screenshot ,I think you are using some measures that's y u r getting this error.it would be great if you can attach the sample workbook.Please let me know if you need any further assistance.


                if you want you can also change the granularity of date by creating a calculated Field and used this new calculated field with the Case statement


                In the Data Window, right-click the Order Date field, and then select Create Custom Date.

                In the Create Custom Date dialog box, do the following:


                    Give the custom date a name. For this example, enter Order Date - Year.

                    For Detail, select Years. Leave the Date Value selected.

                    Click OK.

                • 5. Re: quick question
                  Madhusudhan Khambham

                  Purvi Ajmera if i understood your requirement from the UI stand point of view ..your users should see the sort icon when they hover on the measure field? am i right?



                  Parameters approach works fine, but from user stand point of view make use of measure names and measure values and achieve the sort on the measures...it will work fine.


                  Let us know for any help...

                  • 6. Re: quick question
                    Purvi Ajmera

                    I realize that yes I do have mismatch data type but how can I overcome it?  I tried to create different parameter for each and then doing a calculated field but it did not work.  Attached is my sample workbook if it helps to understand where I’m stuck- any help would be much appreciated !!


                    Thanks Rajeev

                    • 7. Re: quick question
                      Rajeev Pandey

                      Hi Purvi.


                      I tried to open your workbook but i couldn't it took 21 minutes..and still showing executing query.