SQL Server Forums
Profile | Register | Active Topics | Members | Search | Forum FAQ
 
Register Now and get your question answered!
Username:
Password:
Save Password
Forgot your Password?

 All Forums
 Development Tools
 Reporting Services Development
 SSRS - IIF Expression for Avg Calculation
 New Topic  Reply to Topic
 Printer Friendly
Author Previous Topic Topic Next Topic  

azonicds2
Starting Member

United Kingdom
4 Posts

Posted - 02/13/2014 :  10:48:06  Show Profile  Reply with Quote
Hi

I am working on an SSRS report and would like to create 2 separate average calculations at the bottom.

Basically I have a column that will either have the data "LH" or "FH" for the column "Tenure". I am working out days between an opening date and then completion date and have a column that displays this called "Days_to_Complete. I would like to work out the average amount of days for the "LH" tenure records, "FH" tenure records and then the total for both. I have done the easy one of them both first using:

=Avg(Fields!Days_to_Complete.Value)

But i am stuck on how to do it based on whether the tenure is "LH" or "FH". So far I have the below which I know is not complete:

=IIF((Fields!Tenure = "LH", Avg(Fields!Days_to_Complete.Value))

I get the error:
[rsCompilerErrorInExpression] The Value expression for the textrun ‘Client1.Paragraphs[0].TextRuns[0]’ contains an error: [BC30311] Value of type 'Microsoft.ReportingServices.ReportProcessing.ReportObjectModel.Field' cannot be converted to 'String'.

Can anyone help me or point me in the right direction here?

Thanks
Danny

  Previous Topic Topic Next Topic  
 New Topic  Reply to Topic
 Printer Friendly
Jump To:
SQL Server Forums © 2000-2009 SQLTeam Publishing, LLC Go To Top Of Page
This page was generated in 0.04 seconds. Powered By: Snitz Forums 2000