Skip to main content
Announcements
Join us at Qlik Connect for 3 magical days of learning, networking,and inspiration! REGISTER TODAY and save!
cancel
Showing results for 
Search instead for 
Did you mean: 
Anonymous
Not applicable

Pivot table expression sort option

HI All,

      I have a requirement to sort the pivot table which has following demensions and measures:

         Dimensions: aName

                             Region

                             ProdName

                             System Name

           Measure:  MeasureChange

    Sort order requirement:

               aName sort order should be

                           Alert3,

                           Alert2,

                           Alert1

               Region sort order should be

   

RegionName1
RegionName2
RegionName3
RegionName4
RegionName5
RegionName6

              Product Sort order :

   

ProductName2
ProductName1

             

                    

         System Name sort order should be on  measure change column and it should be in descending order.

I tried to use the expression sort order using following expression on system name :

=dual(SystemName,aggr(sum(MeasureChange),AlertName,RegionName,ProductName,SystemName))

still I am not able to achieve above mentioned requirement. Please suggest. Mocked app has been attached. !

6 Replies
Anonymous
Not applicable
Author

Try this...

vinieme12
Champion III
Champion III

You can use either Match() or Wildmatch() for custom sorting

Another Option is to use Dual()  to assign numeric values to the column values during load

example for Dual

Load

Dual(AlertName,Match('Alert3','Alert2','Alert1')) as AlertName

    

sortng.PNG

Vineeth Pujari
If a post helps to resolve your issue, please accept it as a Solution.
Anonymous
Not applicable
Author

Hi Vineeth,

           Still it has been broken on following criteria:            

                Alert1

                            RegionName1

                                             Product Name1 

         System Name1 and 19 should be coming other way as per the sort logic.

vinieme12
Champion III
Champion III

If you want SystemName19 to be on Top then ProductName will be sorted in Ascending Order!

Can you confirm what exactly you need because you specified Descending Order for ProductName!

Vineeth Pujari
If a post helps to resolve your issue, please accept it as a Solution.
Anonymous
Not applicable
Author

System name19 should come in the top of the ProductName1 subsection because it has got measure value of 12 and System Name1 should come below the SysstemName19  because it has got measure value of 10.

ImageForPivotTableSortorder.png

Anonymous
Not applicable
Author

System name should be sorted on the basis of measure descending order