Qlik Community

QlikView Layout & Visualizations

Discussion Board for collaboration on QlikView Layout & Visualizations.

Announcements
QlikWorld 2020: Join us May 11 - 14, 2020 in Phoenix, AZ. Register early and save $400. Learn More
Highlighted
rahulgaadhe
New Contributor III

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
MVP
MVP

Re: Display Top N Values

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

Re: Display Top N Values

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

MVP
MVP

Re: Display Top N Values

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

rahulgaadhe
New Contributor III

Re: Display Top N Values

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

rahulgaadhe
New Contributor III

Re: Display Top N Values

Hi Swuehl,

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

Appreciate your time on this.

Regards,

RG