5 Replies Latest reply: Nov 30, 2011 10:25 AM by Community Administrator

# Sum of a sum

Hello,

I building a table with P&L values and i want to present the cumulative sum of all the groups except the taxes one in one row of the table.

if (PresentatieVolgorde.Group like 'Value before taxes',

if (PresentatieVolgorde.group = 'taxes',

sum(  aggr( Sum ([P&L Detail.Value]),Boeking)))

Best regards

Piskitta

• ###### Sum of a sum

You probably need to include the check for values inside your aggregation, maybe like

=sum(  aggr( Sum ({<PresentatieVolgorde.group = {'taxes'},PresentatieVolgorde.Group = {'Value before taxes'} >}  [P&L Detail.Value]),Boeking)))

These two fields group and Group are really different fields, right?

• ###### Sum of a sum

=if (PresentatieVolgorde.Kostengroep = PresentatieVolgorde.Boeking , aggr( sum ([P&L Detail.Value]),PresentatieVolgorde.Kostengroep), aggr( Sum ([P&L Detail.Value]),Boeking))

This is the expression that i'm using to calculate all the other values.

I get as a result the values from groups because they are the same code:

PresentatieVolgorde.Kostengroep = PresentatieVolgorde.Boeking

But now i need to sum all of the groups except taxes.

I get no result no matter what i try...

Sorry

kind regards

Piskitta

• ###### Sum of a sum

I am still guessing, because I don't really know your data model.

If you want to exclude value 'taxes' from field group, you could either use an if with comparison on non equal,

=sum(  aggr( Sum ( if(PresentatieVolgorde.group <> 'taxes', [P&L Detail.Value])),Boeking))

or using set analysis.

=sum(  aggr( Sum ( {<PresentatieVolgorde.group -= {'taxes'} [P&L Detail.Value]),Boeking))

I am a little confused, because you are using field names with slightly different spelling, or with / without table qualifier, so I am not sure if this is a problem or wanted.

• ###### Sum of a sum

Thanks Stefan.

I was typing wrong. But now it works...

Best regards

Piskitta

• ###### Sum of a sum

A little off-topic...did anyone else see this thread title and think "Sum of a sum of a sailor"?