Skip to main content
Announcements
Qlik Introduces a New Era of Visualization! READ ALL ABOUT IT
cancel
Showing results for 
Search instead for 
Did you mean: 
Anonymous
Not applicable

Display Top N Values

Dear Experts,

Need your help to resolve problem to display top 10 values in a line chart (which is achievable using dimension limits) but doing so chart always displays top 10 irrespective of the number of values selected in dimension field.

My requirement is to show top 10 by default but if more than 10 dimension values are selected chart should be displayed for all the values.

My chart is having two dimensions (Month and Name) and one measure (count distinct).

Any help in this is highly appreciated.

Regards,

RG

1 Solution

Accepted Solutions
swuehl
MVP
MVP

Try something like

=If(GetSelectedCount( Name ) <=10,

     Count({<Name = {"=Rank(Count(DISTINCT Field))<=10"}>} DISTINCT Field),

     Count(DISTINCT Field)

)

and disable the dimension limit option. You almost for sure need to adapt the set expression / rank function to use the correct measure for ranking. If you need more help on this, please post a small sample QVW, as Sunny suggested.

View solution in original post

4 Replies
sunny_talwar

What is the expression you are currently using? Do you have a sample you can share?

swuehl
MVP
MVP

Try something like

=If(GetSelectedCount( Name ) <=10,

     Count({<Name = {"=Rank(Count(DISTINCT Field))<=10"}>} DISTINCT Field),

     Count(DISTINCT Field)

)

and disable the dimension limit option. You almost for sure need to adapt the set expression / rank function to use the correct measure for ranking. If you need more help on this, please post a small sample QVW, as Sunny suggested.

Anonymous
Not applicable
Author

Hi Sunny,

Thanks for taking time to reply to my question but solution given by Swuehl worked and I am getting the required chart with that.

Regards,

RG

Anonymous
Not applicable
Author

Hi Swuehl,

Thanks for your reply and your solution worked and desired output is achieved.

Appreciate your time on this.

Regards,

RG