Skip to main content
Announcements
Qlik Connect 2024! Seize endless possibilities! LEARN MORE
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

Top 10 sales in set analysis

How may i get top 10 sales in set analysis, anyone can u briefly explain it?

12 Replies
kaushiknsolanki
Partner Ambassador/MVP
Partner Ambassador/MVP

Hi,

You can use below expression.

Sum({<Product = {'=Rank(Sum(Sales)) <=10'}>}Sales)

Regards,

Kaushik Solanki

Please remember to hit the 'Like' button and for helpful answers and resolutions, click on the 'Accept As Solution' button. Cheers!
sunny_talwar

I am not 100% confident, but don't we need double quotes around search strings Kaushik?

Sum({<Product = {"=Rank(Sum(Sales)) <=10"}>}Sales)

kaushiknsolanki
Partner Ambassador/MVP
Partner Ambassador/MVP

Sunny,

It works for both.

Regards,

Kaushik Solanki

Please remember to hit the 'Like' button and for helpful answers and resolutions, click on the 'Accept As Solution' button. Cheers!
Mark_Little
Luminary
Luminary

Hi,

Another option is if you're doing it in a chart,

Go to the properties > Dimension limits

Capture.PNG

Mark

sunny_talwar

I guess, I will have to try out with single quotes because I always thought that we needed double quotes for search string.

Update: I guess this confused me... it works, but as HIC mentioned, it would be a bug which might get fixed (which may never get fixed)

Capture.PNG

kaushiknsolanki
Partner Ambassador/MVP
Partner Ambassador/MVP

May be its right,

But I didnt see any misbehavior of using single quote till now, So wont qualify this as a bug.

Regards,

Kaushik Solanki

Please remember to hit the 'Like' button and for helpful answers and resolutions, click on the 'Accept As Solution' button. Cheers!
beck_bakytbek
Master
Master

if you can use this:

if(aggr(Rank(Sum(Sales)),Produkt) <=10, Product,Null())

hope that helps

beck

rwunderlich
Partner Ambassador/MVP
Partner Ambassador/MVP

It is a "bug", in the sense that the code does not match the published documentation. Single quotes were supposed to mean literals, double quotes search strings. But in the actual implementation, they are interchangeable. This has left us with some oddities like '*' does not  search for an asterisk.

I try to code per "the rules", and encourage my students to do so, in the hope that someday we will be able to close this hole.

-Rob

kaushiknsolanki
Partner Ambassador/MVP
Partner Ambassador/MVP

Agree with you Rob..

As per the programming standard, this is a bug for sure.

I was just thinking from a non programmers stand..

Regards,

Kaushik Solanki

Please remember to hit the 'Like' button and for helpful answers and resolutions, click on the 'Accept As Solution' button. Cheers!