Do not input private or sensitive data. View Qlik Privacy & Cookie Policy.
Skip to main content

Announcements
Qlik Named a 7-Time Gartner® Magic Quadrant™ Leader: See the 2026 Report
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

Top N records in straight and pivot Table


Hi,

I impemented, to control Top N records in straight and pivot table with input box along with that if i want to display all the records.

How can i implement.

Thanks,

MLNR

Labels (1)
3 Replies
francoiscave
Partner - Creator III
Partner - Creator III

Hi Narayanareddy,

Can you post a sample app please and the expected result.

It wil be easier for us to help you.

Thanks,

François

maleksafa
Specialist
Specialist

you need to use the rank function, suppose your expression is sum(Sales). so your new expression will be if(rank(sum(Sales)) <=5,sum(Sales)) this will return the top 5, in your case you need to store the value of the input box in a variable and use it in the rank function.

Anonymous
Not applicable
Author

Hi,

Set variable in script:

SET vTopX = 10;

Create Slider Object in UI - select Variable vTopX in variables drop down.

Assign 0 in  MinValue textbox

Assign 50 in  MaxValue textbox

Assign 10 in  Static Step textbox

Next create InputBox object  - select  Variable vTopX

in straight table add expression :

=If(aggr(rank(sum(Sales)),Product)<= $(=vTopX),Product)

Regards

Neetha