Search code examples
ssrs-2008ssrs-2012ssrs-tablix

SSRS if statement to return a blank value


I have two columns in my IIF statements called DEPT_CODE and UNIQUE_CODE what i'm trying to do is return "blank" if the UNIQUE_CODE equals to 2343 else return the DEPT_CODE value.

IIF UNIQUE_CODE = "2343" Then return " " ELSE return DEPT_CODE value

enter image description here


Solution

  • You've basically written it..

    =IIF(Fields!UNIQUE_CODE.Value = "2343", "", Fields!DEPT_CODE.Value)
    

    Note that this returns an empty string. In your pseudo code you had a single space. Change as required.

    The IIF statement works as follows.

    IIF( <boolean expression to evaluate> , <return this if true>, <return this if false> )