Using the IN operator to filter in reporting services

I had some troubles with this one as well. Microsofts own documentation states a simple comma delimited list of values in the Value box should work. This is confusing because IT DOESN'T. At least it didn't for me and I am using SSRS 2012 with Visual Studio 2010.

It turns out that when you are using the IN operator, SSRS is expecting an array of values. There are a number of ways you can make this work for the filter. The following examples are meant to be typed out in the expression editor.

The first way (also the way explained in the blog linked below) is to simply type your comma delimited list in a string value and then use the split function on it.

=split("2B,2C",",")

Or you can derive your list from a multi-value parameter. The multi-value parameter is already an array so all you have to do is reference it via the parameter expression as seen below.

=Parameters!MultiValueParam.Value

I found out this information via the following blog. http://sqlblogcasts.com/blogs/simons/archive/2007/11/20/RS-Howto--Use-the-IN-operator-in-a-filter-expression.aspx


If you just change the Value property and just add a comma separated list of values that should work:

enter image description here

This worked for me in a quick test, anyway.

Books Online seems to be pretty light on examples, but I did find one reference; see the In example in Commmonly Used Filters. It would be nice if this was explained better.


This actually works:

=CStr("Value1,Value2,Value3,Value4,etc").Split(",")

This is tested in SSRS 2012.