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
 SQL Server 2008 Forums
 Analysis Server and Reporting Services (2008)
 help with IIF SSRS 2008
 New Topic  Reply to Topic
 Printer Friendly
Author Previous Topic Topic Next Topic  

joe8079
Posting Yak Master

USA
113 Posts

Posted - 07/07/2012 :  16:20:37  Show Profile  Reply with Quote
I have a simple calculation in SSRS that calculates service level for tickets closed and everything works great. It uses an IIF statement at the beginning to make sure it does not divide by zero and this works. However, I need add a 2nd condition to this report so that I do not SUM any tickets in green and SUM the Total where the job description is like "MGR%" and job Description like "SUPV%"
Here is the name of the field that needs the condition:
Fields!POSITION_DESCR.Value. I need to sum(Fields!GREEN.Value) where Fields!POSITION_DESCR.Value not like "MGR%" or Fields!POSITION_DESCR.Value not like "SUPV%" The same is true for the denonmiator.


=IIF((Fields!GREEN.Value + Fields!YELLOW.Value + Fields!RED.Value) = 0, 0, sum(Fields!GREEN.Value) / sum((Fields!GREEN.Value + Fields!YELLOW.Value + Fields!RED.Value)))



visakh16
Very Important crosS Applying yaK Herder

India
47157 Posts

Posted - 07/07/2012 :  17:09:35  Show Profile  Reply with Quote
nest IIF for that


=IIF((SUM(IIF(Fields!POSITION_DESCR.Value not like "MGR%" Or Fields!POSITION_DESCR.Value not like "SUPV%", Fields!GREEN.Value,0) + Fields!YELLOW.Value + Fields!RED.Value)) = 0, 0, sum(Fields!GREEN.Value) / SUM(IIF(Fields!POSITION_DESCR.Value not like "MGR%" Or Fields!POSITION_DESCR.Value not like "SUPV%", Fields!GREEN.Value,0) + Fields!YELLOW.Value + Fields!RED.Value))


------------------------------------------------------------------------------------------------------
SQL Server MVP
http://visakhm.blogspot.com/

Go to Top of Page

joe8079
Posting Yak Master

USA
113 Posts

Posted - 07/07/2012 :  19:30:46  Show Profile  Reply with Quote
thanks, I'll give that a shot.
Go to Top of Page

visakh16
Very Important crosS Applying yaK Herder

India
47157 Posts

Posted - 07/07/2012 :  20:33:02  Show Profile  Reply with Quote
welcome
let me know if you face any more issues

------------------------------------------------------------------------------------------------------
SQL Server MVP
http://visakhm.blogspot.com/

Go to Top of Page
  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.05 seconds. Powered By: Snitz Forums 2000