Skip to main content
Woohoo! Qlik Community has won “Best in Class Community” in the 2024 Khoros Kudos awards!
Announcements
Nov. 20th, Qlik Insider - Lakehouses: Driving the Future of Data & AI - PICK A SESSION
cancel
Showing results for 
Search instead for 
Did you mean: 
eliko_il
Contributor
Contributor

How to sort horizontal pivot table with 2 dimensions

Hi ,

I need help with the following problem:

This is my pivot table:

pivot.png

First dimension : Year-Month

Second dimension : Part Name


First Expression:

sum([Inventory Qnt]) + RangeSum(Before(Total sum([Inventory Qnt]),1,ColumnNo(Total)))

-

(sum([Forcast Qnt]) + RangeSum(Before(Total sum([Forcast Qnt]),1,ColumnNo(Total))) )

Second Expression:

fabs(

  sum([Inventory Qnt]) + RangeSum(Before(Total sum([Inventory Qnt]),1,ColumnNo(Total)))

  -

  (sum([Forcast Qnt]) + RangeSum(Before(Total sum([Forcast Qnt]),1,ColumnNo(Total))) )

)

/

Factor

The probelm:

I want to sort the Part Name by the Column number of the lowest value of the second expression.

For example in the picture above i mark the lowest value of the second expression per Part Name

and write the column# above.

Part NameMin of second expressionmatch column#
yyy1.251
rrr3.755
zzz95
ttt210
xxx7.51

The final sort that i want to get is:

yyy

xxx

rrr

zzz

ttt

and to hide the second expression from the pivot table.

2 Replies
eliko_il
Contributor
Contributor
Author

Hi,

Any idea how to solve this problem?