Qlik Community

QlikView App Development

Discussion Board for collaboration related to QlikView App Development.

Highlighted
triekong
Contributor

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
Honored Contributor

Re: Sorting 2 fields consecutively in a Pivot Table

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

4 Replies
el_aprendiz111
Valued Contributor

Re: Sorting 2 fields consecutively in a Pivot Table

Hi,

sort.png

triekong
Contributor

Re: Sorting 2 fields consecutively in a Pivot Table

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
Valued Contributor

Re: Sorting 2 fields consecutively in a Pivot Table

Hi,

SORT.gif

effinty2112
Honored Contributor

Re: Sorting 2 fields consecutively in a Pivot Table

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