Skip to main content
Announcements
NEW: Seamless Public Data Sharing with Qlik's New Anonymous Access Capability: TELL ME MORE!
cancel
Showing results for 
Search instead for 
Did you mean: 
ahidu1030
Contributor II
Contributor II

how to calculate the sum of a calculated sum

Hey guys,

I'm searching for help which might be easy for you, but costs days for me to find out a solution...

Original data I have like this in 2 tables.

How Can I calculate / show the total copper weight and silver weight in each month?

I first try to first calculate the copper and silver weight each line item by creating a new measure:

sum(delivery quantity)*[copper weight / part]

then I have difficulty to have a sum of each month based on this formel.

I tried then the function:

sum(Aggr(Sum([Delivery Quantity])*[copper weight / part], [Supplier],[Part]))

But it gives me wrong figure in each month if I show them in a pivot table, however the total sum of all months is correct. Only if I select the exact month, I get the correct value. Why???

Really hope I can get a quick answer.

Table 1: Part master data  

Part SupplierCopper weight / partSilver weight / part
xA0,10,002
yB 0,006
zC0,40,004
wC00

Table 2: delivery quantity each month  

PartSupplierMonthDelivery quantity
xAOct1
xANov2
xADec1
yBOct1
yBNov1
yBDec4
zCOct2
zCNov1
zCDec8
wCOct10
wCNov12
wCDec

13  

5 Replies
sunny_talwar

What happens if you add Month to the Aggr dimension

Sum(Aggr(Sum([Delivery Quantity])*[copper weight / part], [Supplier],[Part], Month))

rupamjyotidas
Specialist
Specialist

If your dimensions in Pivot table is Supplier, Part and month

Then only this expression should work 'Sum([Delivery Quantity])*[copper weight / part]'.

If not working than I am missing something.

ahidu1030
Contributor II
Contributor II
Author

This gives me only when I select a certain part. Because each part has different copper weight and silver weight, it isn't able to give me a total.

ahidu1030
Contributor II
Contributor II
Author

Till doesn't give me the right answer...same result as my function above.

sunny_talwar

Based on the data you have provided above, what is the expected output you are looking to get?