Qlik Community

New to Qlik Sense

Discussion board where members can get started with Qlik Sense.

Announcements
Talk to Experts, a LIVE Q&A Webinar. Bring your Qlik Sense Business questions on Aug. 4th. Register
cancel
Showing results for 
Search instead for 
Did you mean: 
Highlighted
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
Highlighted
Master III
Master III

Re: Ranking Customers based on their sales

May be like this

 

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

 

 

 

Highlighted
Contributor III
Contributor III

Re: Ranking Customers based on their sales

unfortunately it gives the same result

Highlighted
Partner
Partner

Re: Ranking Customers based on their sales

where are you using that expression?

Highlighted
Master III
Master III

Re: Ranking Customers based on their sales

Can you share the sample app

Highlighted
Contributor III
Contributor III

Re: Ranking Customers based on their sales

As a value in a selection button

Highlighted
Partner
Partner

Re: Ranking Customers based on their sales

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
Highlighted
Contributor III
Contributor III

Re: Ranking Customers based on their sales

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

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

thank you all

 

Highlighted
Contributor III
Contributor III

Re: Ranking Customers based on their sales

Correction

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