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.
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.1else 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.0else 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.1else if MAX(fields!MaxN.Value, "PF") between -1 and -10 then --i.e. -6 MAX(fields!MaxN.Value, "PF") - 1.0else 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 MVPhttp://visakhm.blogspot.com/ |
|
|
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? |
|
|
visakh16
Very Important crosS Applying yaK Herder
52326 Posts |
|
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. |
|
|
visakh16
Very Important crosS Applying yaK Herder
52326 Posts |
Posted - 2011-11-02 : 07:25:42
|
no probsyou're wc ------------------------------------------------------------------------------------------------------SQL Server MVPhttp://visakhm.blogspot.com/ |
|
|
|
|
|
|
|