Search code examples
sqlsql-serverreporting-servicesssrs-2008-r2

How to implement 'Not In' Filter in SSRS?


I have a field in SSRS that i need to filter on. For 3 table I can use a IN filter. But I am in need to use a NOT IN operator. The field contains numeric values.

I need to be able to say not in (30,31,32,33,34,35,36,37,38,39)

I can't do it within the dataset either, it needs to be a filter.

How should I achieve it ?


Solution

  • You can use an expression to determine which values are going to be filtered.

    Go to Tablix properties/ Filters

    In expression use:

    =IIF(Array.IndexOf(split("30,31,32,33,34,35,36,37,38,39",","),
    CStr(Fields!YourField.Value))>-1,"Exclude","Include")
    

    For Operator use:

    =
    

    For Value use:

    ="Include"
    

    Let me know if this can help you