13 Replies Latest reply on Feb 20, 2014 10:04 AM by Matt Lutton

    Manual sort with parameter

    Kishore Rasuri

      Hi..I'm using the same workbook provided by Joe Mako in his earlier posts. My question is, in this workbook I have set CustomerName field to manual sort. When i select this value in the parameter i want to show the same manual sort that is in the actual field. I'm not able to figure out a way. I have a similar issue with my actual workbook where i have to push 2 values (Nulls and Deleted) to the bottom of the sort order. For this i'm using manual sort. But when i use it in a parameter that order is lost

        • 1. Re: Manual sort with parameter
          Tracy Rodgers

          Hi Kishore,

           

          I've been playing with it a bit now too, and it seems that the sorting order cannot be forced when it is being used with the parameter. I would recommend adding this to the Ideas section!

           

          -Tracy

          1 of 1 people found this helpful
          • 2. Re: Manual sort with parameter
            Don Barnetson

            Hi Kishore,

             

            I've been trying a few things with this today myself and here is what I came up with. There are a few other ways it can be done. Let me know if it's what you were looking to do.

             

            Thanks,

            Don

            • 3. Re: Manual sort with parameter
              Don Barnetson

              Actually...it can be simplified even more. I have set up 2 options. You can either have your dimensions automatically filter ascending or descending, depending on how you need to sort you data.

               

              Hopefully this helps.

               

              Thanks,

              Don

              • 4. Re: Manual sort with parameter
                Shawn Wallwork

                Hi Don, I think you can simplify that descending calc even more:     

                 

                     -INDEX()

                 

                does the same thing.

                 

                --Shawn

                • 5. Re: Manual sort with parameter
                  Anuja S Krishnan

                  Guys, two questions:

                   

                  1) ascending order the is the default order of dimensions anyway - right? So, even if I did not set up the ascending/descending box, the dimensions would still appear in ascending order - right?

                   

                  2) I looked at the first file attached by Don ("Sort by Multiple Fields.twbx.zip"). Let's say Product Category had an entry "Others" or "Null" and I always want this to appear in the end. Is there way to set a manual order like that?

                   

                  Thanks

                  Anu

                  • 6. Re: Manual sort with parameter
                    Matt Lutton

                    1) Yes, as long as there are no other sorts in the view that would conflict

                    2) If you are referring to a simple field, you can right click the field in the Data window, choose "Default Properties">>"Sort" and you can sort it however you want.

                    • 7. Re: Manual sort with parameter
                      Anuja S Krishnan

                      Thanks Mathew

                       

                      2) But doing that does not change the order of the dimension in a parameter. So, going back to the same .twbx I've mentioned in point (2) above, let's say in Sheet1, I choose "Region" from the parameter "Select Dimension Sheet1". The default sort order for Region is Central, East, West, South. I want to set this as East, West, South, Central. So, when I choose Region from "Select Dimension Sheet1" I want the regions to appear in this order.

                       

                      Please note, I am ignoring the "Select Sort Sheet 2" for now (let's assume this does not exist!) since I am not interested in sorting based on the Sales value.

                      • 8. Re: Manual sort with parameter
                        Matt Lutton

                        Untitled2.png

                        Right, I wasn't sure if you were referring to just a standard field like Product Category (since that is the field you mentioned), or a parameter of some kind.

                         

                        To do this, you need to sort on the calculation that leverages your parameter, rather than trying to sort on the Region field.  Simply choose "Region" from the parameter, then right click on the "Dimensions Sheet 3" pill on the Rows shelf, and choose Sort, and you can manually sort the order there.  This is true for all the options in the parameter.

                         

                        Good luck.  If you have further questions, I might recommend opening a new thread with a packaged workbook attached, as well as any clear goals you are trying to achieve.

                        • 9. Re: Manual sort with parameter
                          Matt Lutton

                          It appears that nobody in this thread mentioned this option for sorting values in a parameter.  It probably isn't documented very well, if at all--but this is the process I've always used (sorting on the calculated field which leverages the parameter).

                           

                          Perhaps a TabWiki doc or something is needed.  I certainly would've expected someone to recommend this method.

                          • 10. Re: Manual sort with parameter
                            Anuja S Krishnan

                            Thanks again.

                             

                            That worked but only for that table or Sheet. What if I have a scenario where I use the parameter in multiple sheets that are then consolidated into a dashboard? (the parameter control box is common to all the sheets in the dashboard). So, I will have to change the Sort order of the calculated item in each Sheet - right?

                             

                            I thought it makes sense to send the reply here since I am referring to your previous reply. Anyway, if you still prefer a new thread, I will go ahead and start one and paste a link here. Let me know and thanks for your time.

                            • 11. Re: Manual sort with parameter
                              Matt Lutton

                              Actually, I just jumped into this thread to try and help you out; I wasn't part of it before then.

                               

                              Its fine to post here, but if you have specific questions that apply to your own workbook/scenario, it is ideal to have a packaged workbook example, and clearly defined goals from the start so folks can provide the best help possible.

                               

                              You may have to do that on all sheets if you've already built them out -- however, if you do this from the start on one sheet, and then create your other sheets by duplicating that sheet and changing the view, the sorting will be preserved.  I typically do the sorting as soon as I create the parameter and add the calculation to one view, then I create the rest of my views by duplicating that (and I typically do the sorting in the Data window rather than on the pills in the view--both will have the same impact here, I believe)

                               

                              I agree it should be much simpler, but its just not!

                              • 12. Re: Manual sort with parameter
                                Anuja S Krishnan

                                Yes, I agree duplicating is a good approach. But it so happened that I had to add some additional columns/dimensions to my raw data after I had set up an entire report in Tableau. While it was not much of a task adding that dimension to the an existing parameter and the related calculated field, setting a manual sort order for the new dimension in each Sheet and Dashboard was painful! I was just hoping there was an easier way to doing that.

                                 

                                Anyway, I appreciate your help  and thanks a lot for your responses.

                                • 13. Re: Manual sort with parameter
                                  Matt Lutton

                                  No worries, best of luck!