mathematical functions that exclude zeros and NULLs

Stimulsoft Reports.WEB discussion
Post Reply
Lynn
Posts: 42
Joined: Tue Oct 06, 2009 9:58 am
Location: United States

mathematical functions that exclude zeros and NULLs

Post by Lynn »

We would like the ability to have math functions (like Avg) that exclude 0 and nulls.
Edward
Posts: 2913
Joined: Fri Jun 09, 2006 4:02 am

mathematical functions that exclude zeros and NULLs

Post 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.
Post Reply