Page 1 of 1

Sum total of column ?

Posted: Tue Oct 30, 2007 9:09 pm
by ymc
Hi,
I have a problem on sum up a column which the values in it was generated out by if condition.
i.e. In one databand I have 3 column called a,b,c..and the 4th column called d is generate out by the condition:
{IIF(c != 0 , c, IIF(b != 0, b, a))}
thus, how can I sum up the total of column d and put it in the footer?

Sum total of column ?

Posted: Wed Oct 31, 2007 5:01 am
by mace242
ymc wrote:Hi,
I have a problem on sum up a column which the values in it was generated out by if condition.
i.e. In one databand I have 3 column called a,b,c..and the 4th column called d is generate out by the condition:
{IIF(c != 0 , c, IIF(b != 0, b, a))}
thus, how can I sum up the total of column d and put it in the footer?
Could you not create a calculated decimal Column for the condition such as System.Convert.ToDecimal(IIF(c != 0 , c, IIF(b != 0, b, a))) then add a summary for that?

I'm thinking you're using decimals in the above example - you may have to change that to the type (integer, etc)

Sum total of column ?

Posted: Wed Oct 31, 2007 1:57 pm
by Vital
Please, try following code:

Code: Select all

{Totals.Sum(datasource, IIF(c != 0 , c, IIF(b != 0, b, a))}
Thank you.