Do not input private or sensitive data. View Qlik Privacy & Cookie Policy.
Skip to main content

Announcements
Streamlining user types in Qlik Cloud capacity-based subscriptions: Read the Details
cancel
Showing results for 
Search instead for 
Did you mean: 
chiayaochang
Contributor II
Contributor II

Sorting by Expression in Pivot Table

Hi, 

I was hoping to use custom sort in Qlik Sense dependent on dimensions. 

Example data set:

LOAD * INLINE [
Factory,Process,Time,
A,QC,1.5
A,Produce,0.7
A,Output,2.1
B,QC,0.5
B,Produce,3.7
B,Output,1.1
C,QC,1.8
C,Produce,1.7
C,Output,2.2];  

I was able to use =Match(Process,'QC','Produce','Output') to sort but this order applies to all first layer "Factory". What I want to achieve is that

"Process" order for Factory A : 'QC','Produce','Output'

"Process" order for Factory B : 'Produce','QC','Output'

"Process" order for Factory C : 'QC','Output','Produce'

I tried 
=pick(match(Factory,'A','B','C'),Match(Process,'QC','Produce','Output'),Match(Process,'Produce','QC','Output'),Match(Process,'QC','Output','Produce')) but it doesn't work as expected.

Labels (2)
1 Solution

Accepted Solutions
tresB
Champion III
Champion III

Used dual(). PFA

 

View solution in original post

6 Replies
tresB
Champion III
Champion III

Try sorting on concatenated field like:

=Match(Factory&Process,'AQC','AProduce','AOutput','BProduce','BQC','BOutput','CQC','COutput','CProduce')

chiayaochang
Contributor II
Contributor II
Author

Hi Tresesco, I just tried but it didn't work on my side.

tresB
Champion III
Champion III

Could you share your sample app?

chiayaochang
Contributor II
Contributor II
Author

Please see attached. Thanks

tresB
Champion III
Champion III

Used dual(). PFA

 

chiayaochang
Contributor II
Contributor II
Author

It works. much appreciated!