troubleshooting Question

Use field name to do calculation in Report Services

Avatar of BobRosas
BobRosas asked on
Microsoft SQL Server 2005SSRS
8 Comments3 Solutions1853 ViewsLast Modified:
I have a report with a field containing this expression...
     =Sum(Count(Fields!ClientFileNo.Value))
The report is grouped on type so the result looks like...
     Served = 115
     Placed = 39
Now I want to find an average (39/115).  I tried...
     =Iif(Fields!Type.Value = "Placed",Sum(Count(Fields!ClientFileNo.Value)),0)/Iif(Fields!Type.Value = "Served",Sum(Count(Fields!ClientFileNo.Value)),0)
but I get 0 as a result.

I've tried adding another table.  I added 2 fields.  One with the expression...
     =Iif(Fields!Type.Value = "Placed",Sum(Count(Fields!ClientFileNo.Value)),0)
and the other with an expression for "Served".  I named the fields txtPlaced and txtServed and the fields contained the correct values so I tried the following code in a third field...
     =ReportItems!txtPlaced.Value\ReportItems!txtServed
The error I get is...
    The value expression for the textrun 'txtRate.Paragraph[0].TextRuns[0]' contains an error: Operator '\' is not defined for types 'Object' ...

How do I go about getting an average from fields being grouped on?
ASKER CERTIFIED SOLUTION
BobRosas

Our community of experts have been thoroughly vetted for their expertise and industry experience.

Join our community to see this answer!
Unlock 3 Answers and 8 Comments.
Start Free Trial
Learn from the best

Network and collaborate with thousands of CTOs, CISOs, and IT Pros rooting for you and your success.

Andrew Hancock - VMware vExpert
See if this solution works for you by signing up for a 7 day free trial.
Unlock 3 Answers and 8 Comments.
Try for 7 days

”The time we save is the biggest benefit of E-E to our team. What could take multiple guys 2 hours or more each to find is accessed in around 15 minutes on Experts Exchange.

-Mike Kapnisakis, Warner Bros