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)
 IIF Statement

Author  Topic 

sprotson
Yak Posting Veteran

75 Posts

Posted - 2012-02-16 : 08:41:12
I have built a very simple matrix report whihc shows whether a call centre agent has a skill enabled or disabled. This is based on the field Skill_on, and for each agent whith the skill can be 0 (disabled) or 1 (enabled).

Agents who do not have the skill do not have an entry in the table, but do in the report as they have other skills assigned to them.

I need to be able to show in the report: Blank (agent does not have skill), Enabled (agent has skill and it is enabled eg 1) and Disabled (agent has skill but it is disabled eg 0).

I have used the following expression, but always receive an error.

=IIF(Fields!Skill_On.Value = "", "",IIF(Fields!Skill_On.value = "1","Enabled","Disabled"))

I am guessing it is because there are no "" entries, because the agent who does not have the skill (either enabled or disabled) does not have an entry in the database table.

Any suggestions how I can get around this?

sunitabeck
Master Smack Fu Yak Hacker

5155 Posts

Posted - 2012-02-16 : 09:00:31
If the value is indeed blank, i.e., empty string, what you have there should work. However, if the value is NULL, you should change it to:
=IIF(Fields!Skill_On.Value is nothing, "",IIF(Fields!Skill_On.value = "1","Enabled","Disabled"))
Go to Top of Page

sprotson
Yak Posting Veteran

75 Posts

Posted - 2012-02-16 : 09:06:06
The value is NULL. It now works

Thanks very much for the help and the quick response
Go to Top of Page

sunitabeck
Master Smack Fu Yak Hacker

5155 Posts

Posted - 2012-02-16 : 09:07:16
quite welcome!
Go to Top of Page

X002548
Not Just a Number

15586 Posts

Posted - 2012-02-16 : 10:16:01
quote:
Originally posted by sprotson
Thanks very much for the help and the quick response



WHAT? You think we are just fooling around here?

Oh, waiter...a Cadillac Rita, Rocks no Salt please

Water Closet

Brett

8-)

Hint: Want your questions answered fast? Follow the direction in this link
http://weblogs.sqlteam.com/brettk/archive/2005/05/25/5276.aspx


Want to help yourself?

http://msdn.microsoft.com/en-us/library/ms130214.aspx

http://weblogs.sqlteam.com/brettk/

http://brettkaiser.blogspot.com/


Go to Top of Page
   

- Advertisement -