I have the following equation - for basic division on a report to get percents.
ex_re_ct/p_ct = some value %
My equation needs to take ex_re_ct
and divide it by p_ct
. However in some cases p_ct
has no value (it's NULL) and since i'm dealing with totals in the SSRS report I can't do this in SQL.
So i wrote the following equation --
=iif( IsNothing((Sum(Fields!p_cnt.Value, "group1_v")))
,0
,((Sum(Fields!ex_re_ct.Value, "group1_v"))/(Sum(Fields!p_cnt.Value, "group1_v")))
)
When i do this. (5 being a dummy value in the equation). It works without issue. But when i put the value in to divide it generates an #Error where there is null data.
=iif( IsNothing((Sum(Fields!p_cnt.Value, "group1_v")))
,0
,((Sum(Fields!ex_re_ct.Value, "group1_v"))/5)
)
please advise.