SQL Clone
SQLServerCentral is supported by Redgate
 
Log in  ::  Register  ::  Not logged in
 
 
 


Filter Expression


Filter Expression

Author
Message
Lucky9
Lucky9
SSC Veteran
SSC Veteran (274 reputation)SSC Veteran (274 reputation)SSC Veteran (274 reputation)SSC Veteran (274 reputation)SSC Veteran (274 reputation)SSC Veteran (274 reputation)SSC Veteran (274 reputation)SSC Veteran (274 reputation)

Group: General Forum Members
Points: 274 Visits: 297
I have to add a filter to the table in SSRS Report

so in the expression i have to select the fieldabc.value
In the operator I am selected the "In" operator
and the value i am saying if the Parameter.value(0) = 'Test' then ("ABC","DEF"),fieldabc.value

so basically what i am trying to do is, based on the parameter selection i am using the IN operator for multiple hard coded values

but when i say below expression it works fine
Parameter.value(0) = 'Test' then "ABC",fieldabc.value

when i try to concatenate another value it's not working
Parameter.value(0) = 'Test' then ("ABC","XYZ"),fieldabc.value
Spiff
Spiff
SSCommitted
SSCommitted (1.7K reputation)SSCommitted (1.7K reputation)SSCommitted (1.7K reputation)SSCommitted (1.7K reputation)SSCommitted (1.7K reputation)SSCommitted (1.7K reputation)SSCommitted (1.7K reputation)SSCommitted (1.7K reputation)

Group: General Forum Members
Points: 1700 Visits: 2234
If I understand what you are trying to do correctly the "in" filter requires an array, you cant pass it multiple values separately. You can create an array by writing all your hardcoded values into a comma delimited string and using split().

So in your filter change your iif statement to:

 =Iif(Parameters!Parameter1.Value(0) = "Test", Split("ABC,XYZ",","), Fields!FieldABC.Value)  


Go


Permissions

You can't post new topics.
You can't post topic replies.
You can't post new polls.
You can't post replies to polls.
You can't edit your own topics.
You can't delete your own topics.
You can't edit other topics.
You can't delete other topics.
You can't edit your own posts.
You can't edit other posts.
You can't delete your own posts.
You can't delete other posts.
You can't post events.
You can't edit your own events.
You can't edit other events.
You can't delete your own events.
You can't delete other events.
You can't send private messages.
You can't send emails.
You can read topics.
You can't vote in polls.
You can't upload attachments.
You can download attachments.
You can't post HTML code.
You can't edit HTML code.
You can't post IFCode.
You can't post JavaScript.
You can post emoticons.
You can't post or upload images.

Select a forum

































































































































































SQLServerCentral


Search