Do not input private or sensitive data. View Qlik Privacy & Cookie Policy.
Skip to main content

Announcements
Posting on Qlik Community is temporarily paused. Thank you for patience and we'll update you soon!
cancel
Showing results for 
Search instead for 
Did you mean: 
giazitzoglou
Contributor III
Contributor III

Ranking Customers based on their sales

I am trying to get the top 10 customers based on their sales and i have this function :

sum({$<DataType=("ACTUAL"), [Customer] = {"=Rank(sum([Weight (Tn)])<=10"}>} [Weight (Tn)])

that gives me as a result zero (0).

What i do wrong?

8 Replies
arulsettu
Master III
Master III

May be like this

 

sum({$<DataType=("ACTUAL"), [Customer] = {"=aggr(Rank(sum([Weight (Tn)])<=10,Customer)"}>} [Weight (Tn)])

 

 

 

giazitzoglou
Contributor III
Contributor III
Author

unfortunately it gives the same result

agigliotti
MVP
MVP

where are you using that expression?

The Power of shining a light on the dark side of your data.
Follow me on my LinkedIn | Know Gamma Informatica at gammainformatica.it
arulsettu
Master III
Master III

Can you share the sample app

giazitzoglou
Contributor III
Contributor III
Author

As a value in a selection button

JordyWegman
Partner - Master
Partner - Master

Hi,

Try this:

sum({$< DataType = ('ACTUAL'), [Customer] = {'=Rank(Sum([Weight (Tn)]),4) <=10'}>} [Weight (Tn)])

The second argument (where I used 4) is assigning it incremental value as oppose to same rank for the same value.... check out the arguments for Rank here. Explanation is by @sunny_talwar .

Jordy

Climber

Work smarter, not harder
giazitzoglou
Contributor III
Contributor III
Author

Now it works if i put it as a measure in a table:

=(sum({$<[Customer] = {'=Rank(Sum([Weight (Tn)])) <=10'}>} [Customer]))

thank you all

 

giazitzoglou
Contributor III
Contributor III
Author

Correction

=(sum({$<[Customer] = {'=Rank(Sum([Weight (Tn)])) <=10'}>} [Weight (Tn)]))