How can we control the number of observation for a straight table in Qlikview?




I have created a straight table in Qlikview and it has two dimensions region and sales person name. Now for every region it is showing detail of all sales persons. Do we have any method to show only a certain number (n) of sales person across every region and can we control this fix number n dynamically means user can provide input as per their requirement? If user put 5 then it must show top 5 sales person for every region and if user put 10 then 10 sales persons.




We can control the number of categories of a dimension in a straight table using “Dimension limit” functionality. Look at the below options, here we have options to restrict values like:-

  • Show only n values, it can be first, largest,smallest based on first expression
  • Show values, those are greater than or equals to an exact amount or relative to other values.
  • Show only those values which accumulates to a certain percentage or an exact amount

Here, your requirement is related with first option with facility to change the value of n dynamically. To perform this follow the below steps:

  1. Create a variable, go to Setting (menu) --> Variable Overview --> Click on ADD to create a new variable. I have created a variable “vSunil

  2. Create a input box ( New Sheet Object --> Input Box) and select the variable name in “General Tab”.

  3. Create Straight table with required dimension and expression and go to “Dimension limits” tab and select “Restrict which values are displayed using first option” and select first available option “Show Only”.

  4. Select Largest and in second box write expression as “=vSunil+1”. Here I have add +1 to group rest of the categories in Others.

  5. Now you can play with number of observation to show at front end.

Hope this helps!