Skip to main content
Announcements
Have questions about Qlik Connect? Join us live on April 10th, at 11 AM ET: SIGN UP NOW
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 (3)
1 Solution

Accepted Solutions
tresesco
MVP
MVP

Used dual(). PFA

 

View solution in original post

6 Replies
tresesco
MVP
MVP

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.

tresesco
MVP
MVP

Could you share your sample app?

chiayaochang
Contributor II
Contributor II
Author

Please see attached. Thanks

tresesco
MVP
MVP

Used dual(). PFA

 

chiayaochang
Contributor II
Contributor II
Author

It works. much appreciated!