Skip to main content
Announcements
Join us at Qlik Connect for 3 magical days of learning, networking,and inspiration! REGISTER TODAY and save!
cancel
Showing results for 
Search instead for 
Did you mean: 
prasanthb123
Contributor II
Contributor II

How to show top N brands plus a specific brand (Using set analysis)

Hi,

I wanted to show top performing brands plus a specific brand (this brand should always be shown irrespective of performance). 

For example:

DateBrandSales
01/06/2018A321,947.6
01/06/2018B291,309.5
01/06/2018C217,505.9
01/06/2018D187,026.8
01/06/2018E84,763.7
01/06/2018F79,457.4
01/06/2018G60,125.7
01/06/2018H44,367.7
01/06/2018X38,146.7

 

The user would enter the Top N brands to display using the input box.

Let's say the Top brands that should be displayed in the chart is 4.

The expected output in the chart is A, B, C, X (The brand X should always be included in the chart)

When the top brands to be displayed in the chart is 5 then the output should be A, B, C, D, X

 

Please help me with the suggestions.

1 Solution

Accepted Solutions
hectormunoz
Contributor III
Contributor III

Hi, you can use something like this 

Sum ({<Brand = {"=Rank(Sum(Sales))<4"} + {X} >}Sales)

and change the "4" by a variable

Regards 

View solution in original post

2 Replies
hectormunoz
Contributor III
Contributor III

Hi, you can use something like this 

Sum ({<Brand = {"=Rank(Sum(Sales))<4"} + {X} >}Sales)

and change the "4" by a variable

Regards 

prasanthb123
Contributor II
Contributor II
Author

Hi Hectormunoz,

Thanks for your quick help. The solution worked perfectly.