I hope you don’t mind I’m going further on this topic, but I don’t understand the difference between the two. Walter if you can find the time, can you say what the Sum-where formula should give me in the following example.
The table:
X Y Z
a m 1
a n 2
a m 3
b n 4
b n 5
b m 6
c m 7
The header detail report :
X=a
Y Z
m 1
n 2
m 3
Sum(if =“m” then ) = 4; Sum() where ( = “m”) = ?
X=b
Y Z
n 4
n 5
m 6
Sum(if =“m” then ) = 6; Sum() where ( = “m”) = ?
X=c
Y Z
m 7
Sum(if =“m” then ) = null; Sum() where ( = “m”) = ?
Altough the purpose of this mail for me is to have a better understanding of the projection mechanism you talked about, I want to repeat BO gives incorrect results. I think you will have a hard time to convince me that it is not a bug, when in a report the same function (in this case the sum-where) gives a different result after I folded and then again unfolded the report, because that is exactly what I did.
Peter
Walter Muellner w.muellner@DELPHI.AT 24/06/98 20:00:50 >>>
Peter Notenbaert wrote:
Well,
Var1=Sum(if = “x” then ) is giving the correct result and where
Var1=Sum() Where ( = “x”) is giving other (incorrect) results.
I do not know what you did exactly, BUT there IS a difference between the two versions!!!
The IF…THEN…ELSE gives you the value on a “by row” basis. In your case, Var1 will give you the value of ‘var2’ only for those ‘records’ which have field1=‘x’ (what happens otherwise?), and, this formula is ‘aggregation enabled’ which means you can use this formula in the headin/footing area of a tabular block and it will be aggregated according to the computation driving dimensions. This also means, that grouping the data on ‘field1’, will give you the (summarized) values of ‘field2’ for the value of Var1 only on the group where field1=‘x’.
The WHEN formula uses relational database projection mechanism and also is aggregation enabled. This means, that you will get the (aggregated) value of ‘field2’ ALSO for the other groups of data, which do NOT have field1=‘x’!
Hope this helps…
Walter.
Listserv Archives (BOB member since 2002-06-25)