Skip to main content
Announcements
Qlik Connect 2024! Seize endless possibilities! LEARN MORE
cancel
Showing results for 
Search instead for 
Did you mean: 
triekong
Creator
Creator

Sorting 2 fields consecutively in a Pivot Table

Hi All,

I already have a pivot table below:

Item'Hours Late''Hours Left'
A1
B9
C5
D10
E35
F42

G

H

53

24



Ignoring the Item column. I would like to sort the two fields separately from largest to smallest (desc), based on the 'Hours Late' field first and then the 'Hours Left' field:

Order#'Hours Late''Hours Left'
110
29
35
41
553
642

7

8

35

24

Please let me know if it is doable. If yes, how? Or will i have to sort it in the load script file.

Would an ideal workaround be to use a regular table instead?

Thanks,

Ekong

1 Solution

Accepted Solutions
effinty2112
Master
Master

Hi Ekong,

This pivot table:

Item Sum([Hours Late])sum([Hours Left])
D10 
B9 
C5 
A1 
G 53
F 42
E 35
H 24

Has the dimension Item sorted by this expression

1000*Sum([Hours Late])+Sum([Hours Left])

descending

Cheers

Andrew

View solution in original post

4 Replies
el_aprendiz111
Specialist
Specialist

Hi,

sort.png

triekong
Creator
Creator
Author

hi Fer Fer,

thanks for responding. 'Sorting by Y value' only sorts the first column for me, but not the 'Hours Left Column'. How did you achieve yours?

-Dimension: 'Item'.

-Expressions: 'Hours Left' and 'Hours Late'
this is what i did: right clicked on pivot table >>> Sort >>>Selected Item >>> Checked Y-value >>> Descending

SortTester2.jpg

el_aprendiz111
Specialist
Specialist

Hi,

SORT.gif

effinty2112
Master
Master

Hi Ekong,

This pivot table:

Item Sum([Hours Late])sum([Hours Left])
D10 
B9 
C5 
A1 
G 53
F 42
E 35
H 24

Has the dimension Item sorted by this expression

1000*Sum([Hours Late])+Sum([Hours Left])

descending

Cheers

Andrew