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

Announcements
Save $650 on Qlik Connect, Dec 1 - 7, our lowest price of the year. Register with code CYBERWEEK: Register
cancel
Showing results for 
Search instead for 
Did you mean: 
MK_QSL
MVP
MVP

Aggr & Rank

What is wrong in below code... My idea is to get TOTAL QTY for TOP 10 Customer...but I am not getting any result

=SUM(IF(AGGR(RANK(SUM([Inv QTY])),[Customer Name])<=10,SUM([Inv QTY])))

1 Solution

Accepted Solutions
MK_QSL
MVP
MVP
Author

Done myself... Thanks to everyone for your help...!!!

=SUM({<[Customer Name] = {"=RANK(AGGR(SUM([Inv QTY]),[Customer Name]))<=10"}>}[Inv QTY])

View solution in original post

10 Replies
israrkhan
Specialist II
Specialist II

Hi,

if you are using Straight table, you can use Dimension limits to get it, very simple..

Not applicable

Hi,

You should use the set analysis lke :

 

= Sum({<FABRICANT_LName= {"=rank(sum([Ventes Unite]), 4)<= 10"}>} [Ventes Unite])

where : FABRICANT_LNAME is the dimension, and Ventes Unite the value sales I want to sum. Here I want to sum up the first 10 manufacturers (Fabricant in french)

if you need to the ranking on a specific period, you should insert a set analysis inside the the rank itself:

= Sum({<FABRICANT_LName= {"=rank(sum( {<Year={2103}>}  [Ventes Unite]), 4)<= 10"}>} [Ventes Unite])

Fabrice

MK_QSL
MVP
MVP
Author

This total I want in text box...

Not applicable

of course

it works in a textbox

just adapt the dimension name and the expression

Fabrice

v_iyyappan
Specialist
Specialist

Try like in textbox,

=Sum({<[Customer Name]={"=rank(Aggr(sum([Inv QTY]),[Customer Name]),4)<=10"} >}[Inv QTY])

Regards,

israrkhan
Specialist II
Specialist II

try this, its working with me...

= Sum({<CompanyName = {"=rank(sum(Quantity))<= 5"}>} Quantity)


Contact name is my dimension.

Gabriel
Partner - Specialist III
Partner - Specialist III

Hi,

I will try

=if(aggr(rank(sum([Inv QTY])),[Customer Name])<=10,Sum([Inv QTY],"Other")

Hope this is helpful

Best Regards,

Gabriel

MK_QSL
MVP
MVP
Author

What is 4 stand for ?

MK_QSL
MVP
MVP
Author

Done myself... Thanks to everyone for your help...!!!

=SUM({<[Customer Name] = {"=RANK(AGGR(SUM([Inv QTY]),[Customer Name]))<=10"}>}[Inv QTY])