Search code examples
ssrs-2008aggregatevisibilityssrs-tablix

Summing Only Visible Rows in SSRS


I'm trying to sum only the visible rows for a report and I know the format is:

=Sum( iif( <use the condition of the Visibility.Hidden expression>, 0, Fields!A.Value))

In my report, I've set row visbility to:

=IIF(CInt(Fields!EM_ET.Value)=1 Or CInt(Fields!EM_ET.Value)= 2,True,False)

Not exactly sure what I'm missing, but when I use this as an expression:

=Sum(IIF(CInt(Fields!EM_ET.Value)=1 Or CInt(Fields!EM_ET.Value)= 2,True,False),0,Fields!EM_ET.Value)

I get this following error: Value expression for textrun'FTD1.Paragraph[0].TextRuns[0]' has a scope argument that is not valid for aggregate function.

enter image description here


Solution

  • You are giving the True/False as output to the SUM() from your expression.You need to change your expression as,

    =Sum(IIF(CInt(Fields!EM_ET.Value) = 1 Or CInt(Fields!EM_ET.Value)= 2,0,Fields!EM_ET.Value))