SSRS Sum of visible value

  • I have hidden and visible recoded for a columns SUM(X), I need the sum of X , But the expression =Sum(Fields!X.Value) gives sum of all hidden and visible. How to get sum of only visible ones.

    ------

    My visiblity condition =IIF(Sum(Fields!A.Value) + Sum(Fields!B.Value) = 0, True, False)

    But i was looking the other sum of the field E.g X

    Can you modify the condition below?

    Sum(IIF(same condition as visibility,field, 0))

  • Sum(IIF(same condition as visibility,field, 0))

  • My visiblity condition =IIF(Sum(Fields!A.Value) + Sum(Fields!B.Value) = 0, True, False)

    But i was looking the other sum of the field E.g C

    Can you modify the condition below?

    Sum(IIF(same condition as visibility,field, 0))

    Still not solved???

  • any feedback

  • Actually yes, I got home after spending 2 hours at the bank and 3 more on the road. Thanks for asking. :hehe:

    How I debug that kind of stuff is that I add 1 textbox in the matrix / tablix and then put the iif as the value for that textbox. That way you can easily debug how ssrs processes the iif and it makes it super easy to adjust the other properties once you have that.

    Let me know how that goes.

  • Visibility Experssion: =IIF(SUM(Fields!A.Value) + SUM(Fields!B.Value) = 0, TRUE, FALSE)

    --

    I have the 3rd columon SUM(Fields!C.Value) the is no condition for thios field in Visibility Experssion

    ??

    SUM(Fields!A.Value) ,SUM(Fields!B.Value),SUM(Fields!C.Value) has values

    10,0,20

    10,10,20

    When i sum up i get 20,10, 4000 like that it was Adding all records of "C"

    I did in the filed Cell "C": =IIF(SUM(Fields!A.Value) + SUM(Fields!B.Value) = 0,0,SUM(Fields!C.Value))

    But still i get wrong answer, Could you please give me exact logic to have Field C in Visibility Experssion when

    SUM(Fields!A.Value) + SUM(Fields!B.Value) = 0 then, SUM(Fields!C.Value) to be zero.

    Urgent???

    Thanks for your feedback

  • I told you how I debug this. Put the iif statement with the expression, then put text for true/false to see what's going on.

    Nothing else I can do here other than doing your job for you.

    My clients are waiting... l8r.

  • I did that before i post.That's is not working?

  • I think you need to look where your final SUM is, compared to ninja's original solution.

  • Thank you, it is working now.

Viewing 10 posts - 1 through 9 (of 9 total)

You must be logged in to reply to this topic. Login to reply