Skip to main content
Announcements
Qlik Connect 2024! Seize endless possibilities! LEARN MORE
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

Calculate a Subtotal for top ten

Hello1

I have a product report ordered by sales value (descending).

I need subtotal for top ten products and all products total.

I dont´t know to obtain this subtotal.

Any one please help me

Thanks in advance.

1 Solution

Accepted Solutions
Not applicable
Author

For top 10 use this:

rangesum(Top(sum(Amount),1,10))


For all products use this:

sum(total Amount)


View solution in original post

4 Replies
Not applicable
Author

For top 10 use this:

rangesum(Top(sum(Amount),1,10))


For all products use this:

sum(total Amount)


Not applicable
Author

Excuse me Nick, Thanks for your response.

But, let me explain with more detail.

My report is similar to next report:

Product Rank Sales 2010 Sales 2009

E 1 100 90

B 2 90 80

C 3 80 72

A 4 70 86

F 5 60 50

H 6 50 65

M 7 45 40

Z 8 40 50

P 9 35 32

Q 10 30 27

SUBTOTAL 600 592

Q 11 25 50

X 12 24 30

L 13 20 5

T 14 10 40

TOTAL 679 717

It is ordered by Rank, I used these function.

I need to insert a subtotal row for top ten products (red row).

This is my problem. Could you help me.

Thanks

nathanfurby
Specialist
Specialist

Only way I could think of doing this was to use a pivot table. See attached example.

nathanfurby
Specialist
Specialist

Sorry - I did make another change to improve the layout and remove the unecessary dimension for sorting. Forgot to save before uploading. Smile

Please find the latest version attached.