Skip to main content
Announcements
Have questions about Qlik Connect? Join us live on April 10th, at 11 AM ET: SIGN UP NOW
cancel
Showing results for 
Search instead for 
Did you mean: 
m_dorz
Contributor III
Contributor III

Nestet aggregation

Hi, 

I can't get this formula out without warning me of an error. How about the correct spelling.

=sum(sum({<[tPurchaseVoucherLine.purchaseVoucherType]={2500},[tPurchaseVoucher.purchaseVoucherState]={0}>}[tPurchaseVoucherLine.quantity])
-sum({<[tPurchaseVoucherLine.purchaseVoucherType]={2020},[tPurchaseVoucher.purchaseVoucherState]={0}>}[tPurchaseVoucherLine.quantity]))

 

Thanks a lot

Martin

3 Replies
rwunderlich
Partner Ambassador/MVP
Partner Ambassador/MVP

I don't think you need the outside sum().  Just

=sum({<[tPurchaseVoucherLine.purchaseVoucherType]={2500},[tPurchaseVoucher.purchaseVoucherState]={0}>}[tPurchaseVoucherLine.quantity])
-sum({<[tPurchaseVoucherLine.purchaseVoucherType]={2020},[tPurchaseVoucher.purchaseVoucherState]={0}>}[tPurchaseVoucherLine.quantity])

m_dorz
Contributor III
Contributor III
Author

Hi, 

Thanks for the info, of course I've already done this variant. The problem should not lie with the formula, but with the fact that there is no line where the result can be entered.
There are the lines where the respective condition is fulfilled, then the correct amount according to the formula is entered, but there is no line where this result can be entered. So I would have to insert a new line in which the result of this calculation can then be entered.
m_dorz
Contributor III
Contributor III
Author

i´ll try to explain my problem once again.

 

the first step is shown in the following excel. 

m_dorz_0-1642783077747.png

if the numbers in the "to" column match the numbers of the "from" column i want to sum up the Numbers in the "wert" column of the Lines of the matching numbers (36 +6)

now i want to substract the  sum above from the value in "wert" of the first matched "to" value  (50-(36+6))

 

i hope you can understand it better now

thanks for your replies

Martin