BusinessObjects Board

Conditional summing syntax?

Hey guys,

This seems like it should be easy to do, but for some reason I’m having trouble getting it to work.

In my report I have one data provider where I pull in and . I would like to create several variables that sum over different ranges of . For example, might include only (“6000”,“6780”,“7322”) and might include (“5200”,“2121”,“8620”).

I’ve been trying formulas like
=sum( in inlist (“6000”,“6780”,“7322”))
=Sum( where InList (“6000”, “6780”, “7322”))

I searched the boards and came up with this thread and tried these two variables:
= inlist (“6000”, “6780”, “7322”)
=Sum( where =“TRUE”)

But I get a syntax error with the second formula.

What am I doing wrong? How can I make this work?

grinder (BOB member since 2005-06-17)

try this create a variable,

=sum(if( <tax/insurance variable>= tax then else if <tax/insurance variable>=insurance then ))


KhoushikTTT :us: (BOB member since 2005-02-24)

Im not sure that I understand.

I’m trying to create some new variables, such as tax and insurance. Tax, insurance, etc… would just be the sum of over certain accounts. I’m having trouble with the “certain accounts” part…


If I have a table with account numbers, I can calculate the rent, insurance, etc… but the calculations only work inside the table. The problem is that I dont want to access the rent, insurance, etc… value in places outside that table.

grinder (BOB member since 2005-06-17)

Could You tell what you meant by outside the table,

Is it you want to disply in a free standing cell???


KhoushikTTT :us: (BOB member since 2005-02-24)

By “outside the table” I mean like in another table as a comparison, for example.

grinder (BOB member since 2005-06-17)

Look at this Reporter FAQ entry instead.
In brief test for the numbers 1 or 0 (and not the character strings “TRUE” or “FALSE”).

Andreas :de: (BOB member since 2002-06-20)

Grinder, did you ever come up with a solution for this? I’m running into the same problem.

jknab (BOB member since 2005-06-28)


Try something like this on you variables

TAX = sum((If inlist (“6000”, “6780”, “7322”) Then Else 0) ForEach )

Insurance = sum((If inlist (“5200”,“2121”,“8620”) Then Else 0) ForEach )

Let me know if this helped.

ximenap (BOB member since 2003-03-11)