HiveBrain v1.2.0
Get Started
← Back to all entries
snippetModerate

SSRS 2008 - How to Total values from an expression

Submitted by: @import:stackexchange-dba··
0
Viewed 0 times
ssrstotalexpression2008howvaluesfrom

Problem

I'm trying to figure out how to total values from a calculated field.

In the example below, I have the following expression:

=IIF(Fields!Role.Value = "Contractor", Fields!actualwork.Value * 100,
Fields!actualwork.Value * 77)


Now I want to provide a total, but it doesn't show up on the report. Is there something I'm missing?

Solution

You actually just put a SUM around the outside:

=Sum(IIF(Fields!Role.Value = "Contractor", Fields!actualwork.Value * 100,
Fields!actualwork.Value * 77))


It will evaluate that row by row and will provide the correct sum.

Code Snippets

=Sum(IIF(Fields!Role.Value = "Contractor", Fields!actualwork.Value * 100,
Fields!actualwork.Value * 77))

Context

StackExchange Database Administrators Q#53127, answer score: 10

Revisions (0)

No revisions yet.