Qlik Community

New to Qlik Sense

Discussion board where members can get started with Qlik Sense.

Announcements
Save the Date: QlikWorld Online, June 24-25, 2020. Free global virtual event for data integration and data analytic gurus. Register Today
Highlighted
New 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.

1 Solution

Accepted Solutions
Highlighted
MVP
MVP

Re: Sorting by Expression in Pivot Table

Used dual(). PFA

 

View solution in original post

6 Replies
Highlighted
MVP
MVP

Re: Sorting by Expression in Pivot Table

Try sorting on concatenated field like:

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

Highlighted
New Contributor II

Re: Sorting by Expression in Pivot Table

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

Highlighted
MVP
MVP

Re: Sorting by Expression in Pivot Table

Could you share your sample app?

Highlighted
New Contributor II

Re: Sorting by Expression in Pivot Table

Please see attached. Thanks

Highlighted
MVP
MVP

Re: Sorting by Expression in Pivot Table

Used dual(). PFA

 

View solution in original post

Highlighted
New Contributor II

Re: Sorting by Expression in Pivot Table

It works. much appreciated!