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 2005 Forums
 Analysis Server and Reporting Services (2005)
 Set parameters depending on multiple conditions

Author  Topic 

harlingtonthewizard
Constraint Violating Yak Guru

352 Posts

Posted - 2008-10-10 : 01:49:49
Within a chart, data, edit values, apperance, series style, fill, colour I have this set:
=iif(Fields!EventCount.Value = 2 , "Green", Parameters!BackgroundColour.Value)

I have two questions?
1. How can I change the above to replace =2 with max.
Data is:
SiteName EventCount
Steve 10
Ben 1
Heather 5

So Steve is set Green as it is Max and other set to Parameters!BackgroundColour.Value.

2. How is the best way within the same expression area to set multiple conditions, this is an extension from question1. So..

iif a do b or iif c do d.... Is this done with iff or case? This is a general question.

visakh16
Very Important crosS Applying yaK Herder

52326 Posts

Posted - 2008-10-10 : 03:11:15
1.=iif(Fields!EventCount.Value = Max(Fields!EventCount.Value,"Scopevalue") , "Green", Parameters!BackgroundColour.Value)
scopevalue can be tablename or groupname or datasetname

2.use Switch() function. look into books online for details.
Go to Top of Page

harlingtonthewizard
Constraint Violating Yak Guru

352 Posts

Posted - 2008-10-10 : 08:13:24
Thanks visakh16 that's what I need. Here is a really good example.
http://weblogs.sqlteam.com/joew/archive/2008/08/20/60693.aspx

Here is my example:

=Switch(Fields!EventCount.Value = Max(Fields!EventCount.Value,"TotalSepDuration_AD"), "Yellow", Fields!EventCount.Value = Min(Fields!EventCount.Value,"TotalSepDuration_AD"), "Orange", Fields!EventCount.Value <> Min(Fields!EventCount.Value,"TotalSepDuration_AD"), Parameters!BackgroundColour.Value)
Go to Top of Page
   

- Advertisement -