sql - How to check for NULL values when using the SUM function in SSRS -
by default, sum function in ssrs excludes nulls. want able check null values in details group , throw error in summary group. in details view use check nulls:
=iif(isnothing(fields!equityprice.value)) ,"#error", fields!equityprice.value*fields!equityshares.value) this works desired.
when use in summary section, ignores nulls , returns sum of non-null values. want return "#error" instead:
=iif(isnothing(sum(fields!equityprice.value))) ,"#error", sum(fields!equityprice.value*fields!equityshares.value)) i have tried eliminating sum in "isnothing" expression no avail. appreciated. in advance!
so confirm, if there @ least 1 null value in group, #error should displayed?
you can use following summary expression:
=iif(sum(iif(isnothing(fields!equityprice.value),1,0)) > 0 , "#error" , sum(fields!equityprice.value * fields!equityshares.value)) this creates count of null values - if count greater zero, return #error.
i made simple report test:


this uses expression @ detail level , mine @ summary. errors group 1 null value required:

Comments
Post a Comment