# New to QlikView

Discussion board where members can get started with QlikView.

New Contributor

## Sum of partial sums

Hi,

I want to get the negative margin of the credit note like in the table below.

OrdnoArtnoSalesMargin
1234111110050
12341111-100-75
1234222220080
12342222-200-90
567811115030
5678222210040
56783333800100

The outcome I want is the sum of the margin on orders where the sum of sales = 0 (so in this example Ordno 1234). The outcome in this case should be -35, but when I use Sum({<Sales={0}>} Margin) I get no result.

Can somebody help me?

4 Replies
MVP

## Re: Sum of partial sums

Try this

Sum({<Ordno = {"=Sum(Sales) = 0"}>}Margin)

New Contributor

## Re: Sum of partial sums

Hi Sunny,

No this doesn't work.

MVP

## Re: Sum of partial sums

Working for me

Valued Contributor III

## Re: Sum of partial sums

yep, this expression is working as required.

=sum({<Ordno={"=Sum(Sales)=0"}>}Margin)