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: 
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
Partner - Champion
Partner - Champion

where are you using that expression?

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)]))