Click here to monitor SSC
SQLServerCentral is supported by Red Gate Software Ltd.
 
Log in  ::  Register  ::  Not logged in
 
 
 
        
Home       Members    Calendar    Who's On


Add to briefcase

Filter Expression Expand / Collapse
Author
Message
Posted Tuesday, July 16, 2013 1:58 PM
SSC Journeyman

SSC JourneymanSSC JourneymanSSC JourneymanSSC JourneymanSSC JourneymanSSC JourneymanSSC JourneymanSSC Journeyman

Group: General Forum Members
Last Login: Sunday, February 16, 2014 9:35 PM
Points: 98, 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
Post #1474280
Posted Wednesday, July 17, 2013 3:42 AM


SSC Journeyman

SSC JourneymanSSC JourneymanSSC JourneymanSSC JourneymanSSC JourneymanSSC JourneymanSSC JourneymanSSC Journeyman

Group: General Forum Members
Last Login: Friday, July 25, 2014 7:47 AM
Points: 83, Visits: 682
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)  

Post #1474473
« Prev Topic | Next Topic »

Add to briefcase

Permissions Expand / Collapse