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 2008 Forums
 Analysis Server and Reporting Services (2008)
 complicated iif for max and min of y-axis range

Author  Topic 

arkiboys
Master Smack Fu Yak Hacker

1433 Posts

Posted - 2011-11-02 : 04:57:58
Hi,
I think for my issue I have to build a complicated iif statement to place inside the maximum and minimum axis range.
The purpose is as follows:
The y-axis of the chart needs to be flexible as follows:
Note that "PF refers to the dataset and MaxN refers to the field"

Question:
1- can the following statements be built only using iif?
2- If so, how can this complicated iif be built please?

This is for Maximum range:

if MAX(fields!MaxN.Value, "PF") <= 1 AND MAX(fields!MaxN.Value, "PF") > 0 then --i.e. 0.3
MAX(fields!MaxN.Value, "PF") + 0.1

else if MAX(fields!MaxN.Value, "PF") > 1 AND MAX(fields!MaxN.Value, "PF") <= 10 then --i.e 8.1
MAX(fields!MaxN.Value, "PF") + 1.0

else if MAX(fields!MaxN.Value, "PF") > 10 then -- i.e. 12.6
MAX(fields!MaxN.Value, "PF") + 2.0

-----------------------------------------------------------------------
This is for minimum range:

if MAX(fields!MaxN.Value, "PF") between 0 and -1 then --i.e. -0.7
MAX(fields!MaxN.Value, "PF") - 0.1

else if MAX(fields!MaxN.Value, "PF") between -1 and -10 then --i.e. -6
MAX(fields!MaxN.Value, "PF") - 1.0

else if MAX(fields!MaxN.Value, "PF") < -10 then --i.e. -12
MAX(fields!MaxN.Value, "PF") - 2.0

visakh16
Very Important crosS Applying yaK Herder

52326 Posts

Posted - 2011-11-02 : 05:30:35
you can use switch also if you want to avoid nested iifs

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

Go to Top of Page

arkiboys
Master Smack Fu Yak Hacker

1433 Posts

Posted - 2011-11-02 : 05:53:46
Do you mean I can use switch inside the report expression?
Go to Top of Page

visakh16
Very Important crosS Applying yaK Herder

52326 Posts

Posted - 2011-11-02 : 05:59:46
yeah you can

see

http://www.bidn.com/blogs/PatrickLeBlanc/ssis/435/reporting-services-switch-function

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

Go to Top of Page

arkiboys
Master Smack Fu Yak Hacker

1433 Posts

Posted - 2011-11-02 : 06:33:22
I have solved the issue by updating the data in the sql.
And thanks for letting me know about the switch statement as it will come in handy.
Go to Top of Page

visakh16
Very Important crosS Applying yaK Herder

52326 Posts

Posted - 2011-11-02 : 07:25:42
no probs
you're wc

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

Go to Top of Page
   

- Advertisement -