0

I have a moderately complex report and toward the bottom I have some summary / calculations being done on the above data. One such calculation simply adds various fields across the report. For example: TextBx1 + Txtbx2 + Txtbx3 etc. Now this might be OK if it was one off but I actually want to do an IIF with it and that IIF statement gets quite long and convoluted. For example:

IIF((TextBx1 + Txtbx2 + Txtbx3...) > 0, (TextBx1 + Txtbx2 + Txtbx3...), Format(0, "F0"))
     ------Eval section--------------    -------------True----------     -----False----

It would be easier to read AND maintain if I could put this val into a variable as such:

IIF(Variables!SumTxt1_10 > 0, Variables!SumTxt1_10, Format(0, "F0"))

However when I try to use a variable in such a manner I get Variable values cannot be used in report language expressions.

So any tips on cleaning up / improving this IIF would be greatly appreciated.

JB

GPGVM
  • 5,515
  • 10
  • 56
  • 97
  • 1
    Convoluted IIF statements are the SSRS way. Perhaps you could add a calculated field to your dataset and use that for the logic. Keep it hidden and only display the result in the target column. – Eric Hauenstein Jul 20 '13 at 20:41
  • Well....based upon your comment I tried to think of ways to improve my sql to reduce reporting logic operations and I came up with a way so...why not turn your comment into an answer and I'll mark it correct. – GPGVM Jul 22 '13 at 16:47

0 Answers0