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)
 iif Statement Using Multi Parameter
 New Topic  Reply to Topic
 Printer Friendly
Author Previous Topic Topic Next Topic  

ZMike
Posting Yak Master

110 Posts

Posted - 08/07/2012 :  09:36:13  Show Profile  Reply with Quote
I have a drop down box that is a multiparameter.

Basically the code I have is this

= IIF(Parameters!FunctionalArea.Label ="ISD",
Sum(Fields!WeekendHolidayHours.Value, "DataSet1") - Sum(Fields!WeekendHolidayHours.Value, "ISD") ,
Sum(Fields!WeekendHolidayHours.Value, "DataSet1"))

I also tried to join the parameter to find the value.

So basically if the value "ISD" is chosen then I want to subtract 2 sums. If it's not I only need 1 sum.

ZMike
Posting Yak Master

110 Posts

Posted - 08/07/2012 :  09:44:48  Show Profile  Reply with Quote
Well this isn't exactly what I was looking for but this does the job for now

= IIF(Sum(Fields!WeekendHolidayHours.Value, "ISD") >0,
Sum(Fields!WeekendHolidayHours.Value, "DataSet1") - Sum(Fields!WeekendHolidayHours.Value, "ISD") ,
Sum(Fields!WeekendHolidayHours.Value, "DataSet1"))


However is anyone knows the answer to my original problem I'd still like to add that to my tips for future reference
Go to Top of Page

visakh16
Very Important crosS Applying yaK Herder

India
47959 Posts

Posted - 08/07/2012 :  10:04:52  Show Profile  Reply with Quote
you can use like this

IIF(Sum(IIF(Fields!WeekendHolidayHours.Value="ISD",1,0)) >0,...

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

Go to Top of Page

ZMike
Posting Yak Master

110 Posts

Posted - 08/09/2012 :  11:42:14  Show Profile  Reply with Quote
visakh16,

I had issues making that work. Although this question is along the same lines.


I have a report that's broken out like this

Group by Year
Group by Month
Department and Data

Under each Month I have a total which is working just fine.

However they want to totals.
The full total (Which I have) and then the Total Minus a department (or more)

If I do
=iif(Fields!FunctionalArea.Value="ISD", Fields!TTLHours.Value,0)

It always returns 0 Since the report doesnt really have a group by on the department. Is there a way to look up the data for the specific deparment and then subtract it for the total ?


If I make a seperate dataset I could subtract the departments but since I cant group by the different datasets on the same tablix (that I can find) that really work work since it pulls in the entire total (all Months instead of grouping by month.)


Go to Top of Page

visakh16
Very Important crosS Applying yaK Herder

India
47959 Posts

Posted - 08/09/2012 :  12:07:51  Show Profile  Reply with Quote
you can do like

=SUM(Fields!TTLHours.value,"your month group name") - Fields!TTLHours.value

in textbox at department level to get total - depthour value

------------------------------------------------------------------------------------------------------
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.08 seconds. Powered By: Snitz Forums 2000