I\'m working on a report where it needs to filter data from either of the two Built-in Fields. so I\'m using the \"FilterExpression\" to query my requirement based on the be
I recently came across the same need do a DATASET FILTER with OR criteria
using an IN operator
and EQUALS (=) operator
.
The answer by [Hannover Fist] includes the expression code with INSTR() function. In my scenario I had to filter against Number Datatype values. DEVELOPERS BE FOREWARNED... the INSTR() expression is only reliable with TEXT Datatype values. See the screenshot provided below.
I don't know why Microsoft doesn't just provide the option to change the assumed [AND] criteria to a configurable [AND/OR] criteria to be selected by the report developer. A configuration filter criteria would be so much simpler than the BOOLEAN FILTER EXPRESSION work-around option.
I would use the InStr function to search for the State field in the list.
Your expression would look like:
=IIF(Fields!Country.Value = "United States" Orelse InStr("Washington,Minnesota,Tennessee, Oregon", Fields!State.Value) > 0, 1, 0)
I usually use 1 and 0 for the filter values - SSRS doesn't always like the TRUE FALSE returned from expressions like 1 = 1 when comparing them as a boolean.
Microsoft: Instr-function