3 Replies Latest reply: Sep 19, 2017 5:27 PM by Marco Wedel RSS

    Sorting Key

    Tyler Gregory

      I want to change the order of my key by customizing it (i.e. Not ascending, descending by x or y value)

       

      I have the following items in my one table ('Not Started', 'In Progress', 'In Review', 'Done', 'Onboarding Unsuccessful').  This is the order I would like them in. 


      How would I write an expression to sort them in this way?

       

      Thank you!

        • Re: Sorting Key
          Sunny Talwar

          May be a sort expression like this

           

          Match(FieldName, 'Not Started', 'In Progress', 'In Review', 'Done', 'Onboarding Unsuccessful')

          • Re: Sorting Key
            Anand Chouhan

            Maybe another one

             

            Only( Match(FieldName, 'Not Started', 'In Progress', 'In Review', 'Done', 'Onboarding Unsuccessful') )


            Or


            Only( {1} Match(FieldName, 'Not Started', 'In Progress', 'In Review', 'Done', 'Onboarding Unsuccessful') )


            • Re: Sorting Key
              Marco Wedel

              Hi,

               

              another solution might be to preload this field e.g. using an inline load and check the "sort by ... load order" option in the sorting tab of your chart properties:

               

              QlikCommunity_Thread_275119_Pic1.JPG

              QlikCommunity_Thread_275119_Pic2.JPG

               

              tabSortStatus:
              LOAD * INLINE [
                  Status
                  Not Started
                  In Progress
                  In Review
                  Done
                  Onboarding Unsuccessful
              ];
              
              table1:
              LOAD RecNo() as ID,
                   Pick(Ceil(Rand()*5), 'Not Started', 'In Progress', 'In Review', 'Done', 'Onboarding Unsuccessful') as Status
              AutoGenerate 100;
              
              

               

              hope this helps

               

              regards

               

              Marco