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

Announcements
Join us in NYC Sept 4th for Qlik's AI Reality Tour! Register Now
cancel
Showing results for 
Search instead for 
Did you mean: 
Anonymous
Not applicable

Top 10 Sales

I'm trying to calculate the sum sales of top 10 Clients in a chart by using:

=if(Aggr(Rank(sum({<Fiscal.WeekNum={$(vCurrWeek)}, Fiscal.Year={$(vCurrYear)}>} Sales)/1000), Sales)<=10, sum({<Fiscal.WeekNum={$(vCurrWeek)}, Fiscal.Year={$(vCurrYear)}>} Sales)/1000)

but not getting any result.

Not sure where I'm going wrong.

7 Replies
Anonymous
Not applicable
Author

Hi Arsalan malik,

in qlikview 11 we have a dimension limits there u can get the result i think.

Anonymous
Not applicable
Author

understand that feature Rajesh but I need to show the sum in a row of Top 10.

Not applicable
Author

Hi,

I think you should do

sum( if(rank(...) <=10, Sales)

(other way round)

Fabrice

MK_QSL
MVP
MVP

1.      Use Client Name as Dimension and tick Supress When Value is Null

2.      Use below formula in expression

=if(Rank(AGGR(sum({$<Fiscal.WeekNum={$(vCurrWeek)}, Fiscal.Year={$(vCurrYear)}>} Sales)/1000), Client_Name)<=10,

  Aggr(sum({$<Fiscal.WeekNum={$(vCurrWeek)}, Fiscal.Year={$(vCurrYear)}>} Sales)/1000),Client_Name)

abeyphilip
Creator II
Creator II

Hi,

Shouldn't the aggregation be done based on the client (and not on the sales)?

Regards,

Abey

shree909
Partner - Specialist II
Partner - Specialist II

Hi  ,

If u are using the version as 11.

Write u r expression as normal  then when u goto the presentaion tab of the straight table   check the option sort indicator.

once u get all the values of the expression sort it by max to min or vice versa.(by clicking on the small arrow )

After that goto the dimension limits check to select the first 10 values.

then ur good to go..

Hope this is helpful..

Not applicable
Author

Try this

Calculated Dimension:=if(Aggr(Rank(sum({<Fiscal.WeekNum={$(vCurrWeek)}, Fiscal.Year={$(vCurrYear)}>} Sales)/1000), Client)<=10, Client)

Expression: =sum({<Fiscal.WeekNum={$(vCurrWeek)}, Fiscal.Year={$(vCurrYear)}>} Sales)/1000