Skip to main content
Announcements
See what Drew Clarke has to say about the Qlik Talend Cloud launch! READ THE BLOG
cancel
Showing results for 
Search instead for 
Did you mean: 
sanpor1zd
Contributor II
Contributor II

filter pane to show top 5

hello,

i have a filter pane with the employees name,

and a table with their sales transaction figures.

im trying to show the top 5 sales figure for each employee. so whenever i select an employee, the table should show the top 5 sales figures. 

i tried using Sum({<Sales= {"=Rank(Sales) <=5"}>}Sales), but it only returns one result

attached is my sample. 

thank you. 

1 Solution

Accepted Solutions
Kashyap_R
Partner - Specialist
Partner - Specialist

Hi

Try this

=if((GetSelectedCount(Zipcode))=1,if(Rank(Price)<=5,Zipcode),Zipcode)

Hope this helps

Thanks

Thanks and Regards
Kashyap.R

View solution in original post

6 Replies
Kashyap_R
Partner - Specialist
Partner - Specialist

Hi

please go thru the attached QVF

hope this helps

thanks

Thanks and Regards
Kashyap.R
sanpor1zd
Contributor II
Contributor II
Author

Hi Kashyap,

your solution works great!

however, when i apply your solution to my current project, i dont understand why it couldnt work. 

ive attached an edited project of mine for your reference. 

im trying to show the top 5 prices for each zip code. 

thank you so much! 

 

Kashyap_R
Partner - Specialist
Partner - Specialist

Hi 

Try this some function works for some scenarios

Hope this helps

Thanks

Thanks and Regards
Kashyap.R
sanpor1zd
Contributor II
Contributor II
Author

Any other ways ? 

ive tried

IF(COUNT(GetCurrentSelections(Zipcode))=1,
if(Rank(Price)<=5,Zipcode),Zipcode)

but the results only rank the price from the highest to the lowest, but did not filter the results to top 5. 

Kashyap_R
Partner - Specialist
Partner - Specialist

Hi

Try this

=if((GetSelectedCount(Zipcode))=1,if(Rank(Price)<=5,Zipcode),Zipcode)

Hope this helps

Thanks

Thanks and Regards
Kashyap.R
sanpor1zd
Contributor II
Contributor II
Author

You are the best 🙂