开发者

Trying to calculate the Average of the non zero rows in a column in an RDLC

开发者 https://www.devze.com 2022-12-31 05:55 出处:网络
Is there any way to caculate the average of the non zero rows only for a column of data in a table in an RDLC for Microsoft report viewer?

Is there any way to caculate the average of the non zero rows only for a column of data in a table in an RDLC for Microsoft report viewer?

ie 0 0 0 5 5 = 5 not 2

I tried Count( fields.n.value > 0 ) to get the count of non zero rows, but it returned the count of all rows.开发者_高级运维

Thanks!

Eric-


Try this:

=Sum(Fields!n.Value > 0) / Sum(IIf(Fields!n.Value > 0, 1, 0))

Notice how the average is computed manually by summing all values then dividing by another sum that mimics a specialized count mechanism.

0

精彩评论

暂无评论...
验证码 换一张
取 消