Page 1 of 1

Sum with Condition

Posted: Wed Feb 18, 2009 7:53 am
by Saro
Hi,

I want to show the summary of a field (Amount), based on another field (Type).

For ex:

No Type Amount (Header)
--- ------ ----------
1 A 23.00 (Details)
2 B 14.00
3 A 12.00
4 B 42.00
5 C 25.00
_________________

Sum of A 35.00 (Footer)
Sum of B 56.00
Sum of C 25.00



Image



I was trying to use cSumIf(Band,Expression,Condition) as

cSumIf(Databand1, Amount, Type="A")
cSumIf(Databand1, Amount, Type="B")
cSumIf(Databand1, Amount, Type="C")

But it shows zero when the Expression field and Condition field are different. It allows me to use the same field in both Expression and Condition.

Can someone guide me to achieve this.

Thank you,
Saro

Sum with Condition

Posted: Thu Feb 19, 2009 2:35 am
by Edward
Hi Saro,

The easiest possible way is to use "Data from other Data Source" DataSource. In that new datasource you could group the data as required and add aggregate columns functions which would calculate 'Sum of A', 'Sum of B', etc.

Thank you.