Page 1 of 1

mathematical functions that exclude zeros and NULLs

Posted: Wed Oct 21, 2009 10:28 am
by Lynn
We would like the ability to have math functions (like Avg) that exclude 0 and nulls.

mathematical functions that exclude zeros and NULLs

Posted: Fri Oct 23, 2009 4:00 am
by Edward
Hi Lynn,

Please use the following expressions:

// with 0 values included, without nulls:

Code: Select all

{Div(Totals.Sum(MyDataSource, MyDataSource.MyDataColumn),Totals.Sum(MyDataSource,IsNull(MyDataSource,"MyDataColumn")?0:1),0)}
// without 0 and nulls:

Code: Select all

{Div(Totals.Sum(MyDataSource, MyDataSource.MyDataColumn),Totals.Sum(MyDataSource,(MyDataSource.MyDataColumn==0)|IsNull(MyDataSource,"MyDataColumn")?0:1),0)}
Thank you.