4 Replies Latest reply: Jan 21, 2013 6:22 AM by Jonathan Brough RSS

    Customized sort in Legend

    Rahul Burri

      Hi All,

      In my Legend I want to show my product as first position and remaining product according to sorting order (A-z) and others should be last. Could you please help me how can we achieve it?

      Thanks,

      Rahul

        • Re: Customized sort in Legend
          Jonathan Brough

          It's not possible to sort on the secondary dimension. See post: http://community.qlik.com/message/104396#104396. I think the sorting applies across the whole of the first expression, irrespective of the slicing by dimensions.

          You may be able to force the sort order of the secondary dimension by adding in a 'dummy' first expression that doesn't have any display options ticked (i.e. not bar, line etc.). In this expression you could ask for a count of the product name. As this should return 1 for all the products they may be delievered in alphabetic order.

          Jonathan

          • Re: Customized sort in Legend
            Jonathan Brough

            You have only one dimension ? You don't mean the legend that appears in the top right corner of a chart ?

            If so, then yes, on Sort properties tick Expression, set to only(Product). This shouldn't be necessary though as ticking Text should have done that for you. Maybe best to post a picture or an application.

            Jonathan

              • Re: Customized sort in Legend
                Jonathan Brough

                Apologie, I see your custom sort requirement now.

                I'd advise you to add another field called SortProductName, with the product name (or just the first 10 characters of the product name) in it if performance is an issue, and with your product set to 'aaaaaaaaaa'. You can then got to the Sort properties, tick Expression, set to only(SortProductName).

                Jonathan