Arul
Arul

Reputation: 3

Using 'like' in SSRS parameter check

I'm trying to show or hide column when the value has the word 'decease' from the parameter values (parameter name is FILTERBYand it contains multiple values). I'm trying to use the expression:

=IIf(Parameters!FILTERBY.Value like "*decease*",False,True)

This is not working. The FILTERBY parameter is a text datatype and Allow Multiple values option is enabled. What am I doing wrong?

Upvotes: 0

Views: 2443

Answers (1)

Bojan Borisovski
Bojan Borisovski

Reputation: 852

If allow multiple parameters is set, you should expect that the parameter FILTERBY is an array of values. In such a case you should use the Join or String.Join function to make a string out of the parameter values array, and then check if it contains the string.

Try the following:

IIF(InStr(Join(Parameters!FILTERBY.Value,","),"decease")>0, False, True)

or to better suite the question

IIF(Join(Parameters!FILTERBY.Value,",") like "*decease*", False, True)

Upvotes: 2

Related Questions