Qlik Community

New to Qlik Sense

Discussion board where members can get started with Qlik Sense.

Announcements
Coming your way, the Qlik Data Revolution Virtual Summit. October 27-29. REGISTER
cancel
Showing results for 
Search instead for 
Did you mean: 
Highlighted
Contributor II
Contributor II

Filter pane and set analysis table for top 5.

Hello,

I have a filter pane which consists of employee names, 
and also a table to show the top 5sales from the selected employee. 

i've tried using 
Sum({<Employee= {'=Rank(Sum(Sales)) <=5'}>}Sales)

but all i get was one column in my table.

Thank you. 

Edited (I have included a sample data)

10 Replies
Highlighted
Partner
Partner

Hi,

Use below exp:

IF(RANK(SUM([Sales]))<=5,SUM([Sales]))

Highlighted
Contributor II
Contributor II

Hi,

Ive tried the code provided.
But the table only return 1 result. 

 

thank you.

Highlighted
MVP
MVP

Since you need to get top Sales, your ranking has to be based on sales. Try lie:

Sum({<Sales= {"=Rank(Sales) <=10"}>}Sales)

Highlighted
Contributor II
Contributor II

Hi,

the code only return 1 result after filtering. 

 

Highlighted
MVP
MVP

Could you share a screenshot of where and how you are trying this?

Highlighted
Contributor II
Contributor II

I have edit my post with a sample file for reference.

Whenever i choose a name using the filter pane, it only returns 1 result in my table.
Im trying to return the top 5 sales 

Capture.JPG

Highlighted
Creator II
Creator II

Hi,

Since you are using only one measure, it simply sums first 5 sales. In order to get 5 rows with top 5 sales, you should add a dimension which should be a rank column.

Highlighted
MVP
MVP

Create a master dimension like:

=Aggr(Sum({<Sales = {"=Rank(Sum(Sales)) <=5"}>}Sales), Sales)

Capture.PNG

Highlighted
Contributor II
Contributor II

i tried the method, but the table only show the sales which the person have, not the top 5. test1.JPGtest2.JPG