Sign In | Feedback | Donate | Search
Katie and Emil Logo
Vote Yes! I like it! [+0]  |  Vote no! Dislike? [-0]
Author: by Katie Glownia

In this SSRS Tutorial I will show you IIF expression which is also know and IF THEN ELSE statement that allows to provide a condition that can be evaluated to either TRUE or FALSE and provide a value for TRUE part and for FALSE part. In this SSRS Tutorial I will use SQL Server Reporting Services 2008 R2 but it should work with SSRS 2005, 2008 and 2012.

To create SSRS IIF expression please follow my tutorial.

In my example I will check if a person lives in Bristol if yes I will display Yes in a separate column and if not the cell will be blank.

 

I already have SSRS report and a table and I have fields Surname, City and Country. I insert new column to the right that will contain SSRS IIF expression.

 

I will call the new columm header 'Lives in Bristol' and I will add IIF expression. To add expression I right click the cell and click expression command.

Expression dialog box appears where I will use IIF function. The first argument is condition and in my case I check if field values is = "Bristol" if yes then "Yes" else "" which means if field value = "Country" then it will return true part of IIF function which is second argument in my case I have values "Yes" else is my false part which means that if City does not equal "Bristol" it will return empty string "" and false part is a third argument n the inline IF (IIF) function.

Below is an example of IIF Expresion

Let's preview our report. You can see our IIF expression worked and if someones lives in Bristol then we get YES else we get nothing.

I hope this SSRS tutorial will help you to create your own SSRS IIF Expressions.

 

Take care

Katie

Upsss... Something went wrong and Google Ads on our website did not display.

Google ads sponsor FREE content on our website and without them it would not exist.

How to fix the problem?
  1. Check if the Google Search display any ads by searching the term Business Intelligence
    • If ads don't display, try different search terms and if there no ads then there might be a problem with your browser. If you made changes to your browser behaviour then undoing them will help.
    • If ads display then, refresh our page one more time, if the problem is still there than please contact us.
  2. Become 'No Ads Learner' Member or if you are already one Sign In.
Close
Take care
Katie & Emil
Well done! It seems Google Ads display properly now on our website.

Access our website's FREE content for FREE!