8 Replies Latest reply: Jul 3, 2017 8:27 AM by Brent Smits RSS

    Sorting in pivot tables (using calculated expression?)

    Brent Smits

      Heyy

       

      I made a pivot table calculating some percentages and absolute values. However, I want the table to sort based on the total of the absolute values. So now I have: see screenshot 1

       

      and what I want is that Netherlands is on top, then Belgium, then Germany and lastly France because the total absolute value is the following:

      Netherlands: 6424

      Belgium: 3518

      Germany: 1460

      France: 988

       

      I tried using the following as calculated dimension:

      =if(aggr(rank(count(field)),land)<=4,land)

      But this does not give me the result I want.

      field = the field I use for the absolute value.

       

      I use the 4 countries as a filter so I have them selected, I can also ask it to calculate those totals because the columns are pivotted using another field so just removing this field from the dimensions gives me the totals. So how to get Qlikview to sort using these values?