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

Leave a Comment