Search code examples
reporting-servicesssrs-tablix

Filter tablix with two "Like" operations combined by an "Or"


I need to filter on a tablix to return where values in the string contains "BLACK" OR "RED":

Expression:  =Fields!DrawOfficeNum.Value Like "*BLACK*" AND Fields!DrawOfficeNum.Value Like "*RED*"
Operator:    Like
Value:       True

I'm getting no results back and I know there is results. Help will be greatly apreciated!


Solution

  • I would do it like this:

    Expression (Text type):

    =IIf(InStr(Fields!DrawOfficeNum.Value, "BLACK") > 0 or InStr(Fields!DrawOfficeNum.Value, "RED") > 0
        , "Include"
        , "Exclude")
    

    Operator: =

    Value: Exclude

    enter image description here

    This gives results:

    enter image description here

    Only thing to not is that I turned the filter from a Boolean to a Text type - in the past I've always had problems with Boolean filters and the option above works well, as per the screenshot.