Skip to main content
Announcements
Join us at Qlik Connect for 3 magical days of learning, networking,and inspiration! REGISTER TODAY and save!
cancel
Showing results for 
Search instead for 
Did you mean: 
VL126
Contributor
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 :

UnitsSub UnitsValue
15-        2,149
12          4,403
12-        4,788
11       14,385
15          1,426
15          9,755
12          8,977
13          6,601
15       10,640
22             553
24          9,505
21-        8,241
21          4,994
23          9,264
22          1,003
23       14,108
32          5,799
33-        9,656
34-           825
34       14,674
35          3,616
33          4,454
44-        1,252
41       15,394
42-        5,478
52          7,964
54-        8,916
53          5,312
55-        5,410

 

1 Solution

Accepted Solutions
Channa
Specialist III
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

View solution in original post

4 Replies
Channa
Specialist III
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
VL126
Contributor
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. 

 

Thanks for your help.

 

 

Channa
Specialist III
Specialist III

No need limitation just add as dimension
Channa
VL126
Contributor
Contributor
Author

thanks