Qlik Community

New to Qlik Sense

Discussion board where members can get started with Qlik Sense.

vix_humix
New Contributor

Sorting on QS pivot table

hi all,

i have a pivot table like this pivot_table.PNG

how to sort the inner field "area" and "cell" from highest to lowest based on the "count(Result)"?

i have already checked the sort by expression with expression "count(Result)" for both "area" and "cell", but can't get the result that i want.

Thank.

Tags (1)
6 Replies
darkhorse
Valued Contributor

Re: Sorting on QS pivot table

Hello,

Try sorting with Aggr() function.

aggr(count(RESULT),BOBSLED,AREA,CELL)

If you don't use aggr(), count() works on the total level, not in the dimensionality you want to aggregate at. Meaning, it ignores, BOBSLED and area dimensions.

BR

Serhan

vix_humix
New Contributor

Re: Sorting on QS pivot table

hi Serhan,

shld i using uuttype rather than BOBSLED? but i tried both

i replaced the expression with aggr(count(Result), uuttype, area, cell) but it didn't work,

can you explain in more detail?

darkhorse
Valued Contributor

Re: Sorting on QS pivot table

Hello,

Is it possible you send me the application?

BR

Serhan

vix_humix
New Contributor

Re: Sorting on QS pivot table

hi Serhan,

here is my sample app

Thanks

darkhorse
Valued Contributor

Re: Sorting on QS pivot table

Hey,

Sorry, my bad. Exactly I meant uttype instead of BOBSLED. I have bad eyes

Also I thought this technique would work like in QlikView without testing.

I checked community a bit and there are many entries like that. So it means it is not the same behaviour as in QlikView.

Please check the following and refer to Gysbert's answer. He is quite an expert.

https://community.qlik.com/thread/165277

I applied his solution with a simplification in your app. It should be the same logic when the third dimension comes into play. Attached is your app.

BR

Serhan

vix_humix
New Contributor

Re: Sorting on QS pivot table

hi Serhan,

thank you for your suggestion, but

it seems like it is not perfectly sorted, and have some duplicate cell field appear.

n i tried another way to create a variable to sort it but also cant work perfectly.

im confused.