Announcements
cancel
Showing results for
Did you mean:
Contributor

## Straight table to only show top 10 values

Hi all,

I am new to Qlik sense and would need some help on a question. I have a list of values which could be of positive or negative amounts. In a straight table, how could I only show the Top 10 items by Unit ( 5 from positive side and 5 from negative side)?

In addition, normally see the total as the top row of a straight table. How I could make it to the last row. eg in my data below, would like to total by Unit and have it as the last row.

My data :

 Units Sub Units Value 1 5 -        2,149 1 2 4,403 1 2 -        4,788 1 1 14,385 1 5 1,426 1 5 9,755 1 2 8,977 1 3 6,601 1 5 10,640 2 2 553 2 4 9,505 2 1 -        8,241 2 1 4,994 2 3 9,264 2 2 1,003 2 3 14,108 3 2 5,799 3 3 -        9,656 3 4 -           825 3 4 14,674 3 5 3,616 3 3 4,454 4 4 -        1,252 4 1 15,394 4 2 -        5,478 5 2 7,964 5 4 -        8,916 5 3 5,312 5 5 -        5,410

1 Solution

Accepted Solutions
Specialist III

=aggr(if(rank(sum(Value))<=5 or rank(-sum(Value))<=5,units),units)

this need to be ur Dimension

measure:sum(Value)

this will bring top and bottom 5 units

Channa
4 Replies
Specialist III

=aggr(if(rank(sum(Value))<=5 or rank(-sum(Value))<=5,units),units)

this need to be ur Dimension

measure:sum(Value)

this will bring top and bottom 5 units

Channa
Contributor
Author

Hi Channa,

Thanks.

Very new to this. For the Dimension Expression "=aggr(if(rank(sum(Value))<=5 or rank(-sum(Value))<=5,units),units)". May I confirm whether it should put under the Field Expression Editor or Limitation/Show Column if section? Actually i tried both but not working as expected.

When putting that under Limitation, and select "exact value", it returns the positive to me but not the negative.