# QlikView App Development

Discussion Board for collaboration related to QlikView App Development.

Highlighted
Contributor

## Sorting 2 fields consecutively in a Pivot Table

Hi All,

I already have a pivot table below:

 Item 'Hours Late' 'Hours Left' A 1 B 9 C 5 D 10 E 35 F 42 GH 5324

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' 1 10 2 9 3 5 4 1 5 53 6 42 78 3524

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

Tags (2)
1 Solution

Accepted Solutions
Honored Contributor

## Re: Sorting 2 fields consecutively in a Pivot Table

Hi Ekong,

This pivot table:

 Item Sum([Hours Late]) sum([Hours Left]) D 10 B 9 C 5 A 1 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
Valued Contributor

Hi,

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

Valued Contributor

## Re: Sorting 2 fields consecutively in a Pivot Table

Hi,

Honored Contributor

## Re: Sorting 2 fields consecutively in a Pivot Table

Hi Ekong,

This pivot table:

 Item Sum([Hours Late]) sum([Hours Left]) D 10 B 9 C 5 A 1 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