Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to add a total count column for an expression field

If I have a table (tablix) in SSRS, and one of the columns is a simple expression:

=Fields!NumPorts.Value - Fields!PortsUsedLastQuarter.Value

Then how can I add a "total count" column for this? I can't add a total column, it's greyed out because it's an expression and not a simple field.

Thanks

like image 432
Matt Roberts Avatar asked Feb 19 '23 05:02

Matt Roberts


1 Answers

There are a few different ways to do this. I think the most general purpose way is:

  1. Right click on the grouping that you want to total. Sound like in your case this will be the details group. (You can find a list of groups in the Row Groups pane of the designer window.

  2. Select "Add Total -> Before" (or after)

    You should now have a row to add the totals into. SSRS tries to figure out what totals to insert. If those are appropriate, leave them, but in your case we will need to edit the expression of a cell.

  3. In the cell you want your total, right click and select Expression. (The same process could be followed for a placeholder in the cell as well.)

  4. In the Expression window, Enter =SUM(Fields!NumPorts.Value - Fields!PortsUsedLastQuarter.Value)

like image 99
Jamie F Avatar answered Mar 13 '23 04:03

Jamie F