I have a simple % change formula I want to implement into a report... the formula being (a-b)/b.
Issue is sometimes the value for b coming into the data set is blank/null... and furthermore SSRS can't ever seem to accurately realize this through the iif()
statement I'm using. Instead whenever the report renders, for any line item where data for b in the formula is missing I get the dreaded "ERROR" showing up in that cell. The formula in the cell I'm using is below. What's the issue here? Why can't SSRS see that sum(b) = nothing
or isnothing(sum(b))
evaluates to true? It's like it bypasses that part of the formula and goes ahead and does the math, divides by 0 and throws and error?
=iif(
isnothing(sum(Fields!BR_Quantity.Value))=true or sum(Fields!BR_Quantity.Value)=0 or sum(Fields!BR_Quantity.Value)=nothing,
nothing,
(sum(Fields!Full_Case_Quantity.Value)-sum(Fields!BR_Quantity.Value)) / sum(Fields!BR_Quantity.Value)
)