Skip to main content
Announcements
Qlik Connect 2025: 3 days of full immersion in data, analytics, and AI. May 13-15 | Orlando, FL: Learn More
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

Total of Top 10 Values

Hi All,

I have the top10 ReasonCodes based on the count of a field(ID's).

Now, for these top 10 Reasoncodes i am calculating the Sum of a filed(i.e., sum of Quantity). I want to calculate the Total value of these sum(Quantity) for my top 10 Reasoncodes. If i am using the expression sum(total Quantity), it is giving me the total sum for all the Reasoncodes but not for my top 10 Reasoncodes. Kindly help me in this. Thanks in anticipation:-)

Message was edited by: N Nadiya

12 Replies
sinanozdemir
Specialist III
Specialist III

Hi,

Maybe something like the below:

Sum({<ID={"=Aggr(Rank(Sum(Quantity)), ID)<=10"}>} Total Quantity)

If you have sample data, it might be easier to come up with the right syntax.

Thanks

vishsaggi
Champion III
Champion III

Where exactly you are using this expression ? Can you share a sample app?

Not applicable
Author

Hi Sinan and Vish..

I will be using this expression for my size of the bubble in bubble chart and also in the straight table.

vishsaggi
Champion III
Champion III

Did you try what Sinan suggested ? Like just added the fields to his expression.

=Sum({<reasoncode ={"=Aggr(Rank(Sum(quantity)), reasoncode)<=10 "}>} Total quantity)

rupamjyotidas
Specialist
Specialist

Sum({<mt_id={"=Aggr(Rank(Sum(quantity)), mt_id)<=10"}>} Total quantity)

Sinan is correct.

Not applicable
Author

I did try.. Its working for the sample which i had uploaded i.e., im getting the answer as 155 but the same expression is not working in my real qv file .. I am getting +5% variation.. not sure why:(

vishsaggi
Champion III
Champion III

Can you send use the expression you are using in your real QV and the screenshot of that ?

Not applicable
Author

Find the screenshot Vish and can you please explain me the expression ??

On 3 September 2016 at 00:30, Vish Nagaraju <qcwebmaster@qlikview.com>

Not applicable
Author

scrrenshot.png

Here is the screenshot Vish and can you please explain me the expression ?