Please start any new threads on our new site at https://forums.sqlteam.com. We've got lots of great SQL Server experts to answer whatever question you can come up with.

 All Forums
 SQL Server 2012 Forums
 Analysis Server and Reporting Services (2012)
 IIF Switching for expression? (Report Builder 3)

Author  Topic 

mikeinsantarosa
Starting Member

3 Posts

Posted - 2014-03-09 : 22:22:33
I'd like to limit the value of a calculated progress field to 100 (%) in the event the math reveals something > 100.
Right now the field looks something like:
=(Sum(fields!ActutalTested.Value)/(Sum(fields!RequiredTested.Value)*100

Can I use an IIF or something similar here? Can I alias the output of the expression so it's look like:
=IIF((Sum(fields!ActutalTested.Value)/(Sum(fields!RequiredTested.Value)*100) AS RealResult <= 100, RealResult, 100)

Any ideas?

thanks
Mike

sz1
Aged Yak Warrior

555 Posts

Posted - 2014-04-01 : 10:46:55
Cant check at the mo as Im not on a reporting server but the syntax is something like

=Sum(IIF(fields!ActutalTested.Value)/(Sum(fields!RequiredTested.Value)*100) <=100, RealResult, 100)

Some examples for you:
=sum(iif(Fields!DateDiffAll.Value >=0,1,0) and Fields!STATUS_NAME.Value <>"Closed") and Fields!ASSIGNED_GRP_NAME.Value ="this is a filter"


Use this dataadd
=Sum(IIF(Fields!Agreed_Solved_Date___Time.Value = DateAdd("d",-1, TODAY()),1,0))

=Sum(IIF(Fields!DateDiff.Value =0,1,0 and Fields!Agreed_Solved_Date___Time.Value = Today()))


We are the creators of our own reality!
Go to Top of Page
   

- Advertisement -