Qlik Community

Ask a Question

QlikView App Dev

Discussion Board for collaboration related to QlikView App Development.

Announcements
Support Cases coming to Qlik Community Oct. 4! Start chats, open cases, explore resources: READ DETAILS
cancel
Showing results for 
Search instead for 
Did you mean: 
txepulin
Contributor
Contributor

Rank function

Hello,

As much as I searched, I can't find the answer.

I've a table with a single dimension, StoreCodeDesc, and I want to know the weight of the top 100 of the best selling products on the total sales of each store.

On the one hand I want to know the weight that the Top 100 global has, I use the formula:

Sum ({<ArticleCode = {'= rank (Total Sum (NetAmount)) <= 100'}>} NetAmount) / sum (NetAmount)

For another hand I want to know the weight of the Top 100 of each store with the formula without Total:

Sum ({<ArticleCode = {'= rank (Sum (NetAmount)) <= 100'}>} NetAmount) / sum (NetAmount)

Both formulas give me the same result, the weight of the top 100 global sales of each store, but I don't get the weight of the top 100 of each store.

Any ideas?

Regards

2 Replies
sunny_talwar

For each store, you can try this

Sum(Aggr(If(Rank(Sum(NetAmount)) <= 100, Sum(NetAmount)), Store, ArticleCode))

txepulin
Contributor
Contributor
Author

Thanks, it works perfectly.