简体   繁体   English

如何在SSRS中实现“不在”过滤器?

[英]How to implement 'Not In' Filter in SSRS?

I have a field in SSRS that i need to filter on. 我在SSRS中有一个我需要过滤的字段。 For 3 table I can use a IN filter. 对于3表我可以使用IN过滤器。 But I am in need to use a NOT IN operator. 但我需要使用NOT IN运算符。 The field contains numeric values. 该字段包含数值。

I need to be able to say not in (30,31,32,33,34,35,36,37,38,39) 我需要能够说不在(30,31,32,33,34,35,36,37,38,39)

I cant do it within the dataset either, needs to be a filter. 我不能在数据集中做到这一点,需要是一个过滤器。

How should I achieve it ? 我应该如何实现它?

You can use an expression to determine which values are going to be filtered. 您可以使用表达式来确定要过滤哪些值。

Go to Tablix properties / Filters 转到Tablix properties / Filters

In expression use: expression使用:

=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: 对于Value使用:

="Include"

Let me know if this can help you 如果这可以帮到你,请告诉我

Firstly I would like to say that, to my knowledge, NOT IN is not available in list of operators for filters. 首先我想说的是,据我所知, NOT IN在过滤器的运算符列表中不可用。

To Achieve the same thing in other way, please refer the following link..it might help you... 要以其他方式实现相同的目的,请参考以下链接..它可能会帮助您...

http://blog.datainspirations.com/2011/01/20/working-with-reporting-services-filters-part-4-creating-a-not-in-filter/ http://blog.datainspirations.com/2011/01/20/working-with-reporting-services-filters-part-4-creating-a-not-in-filter/

For a variation of the selected answer that I find easier to use, please see below. 有关我发现更容易使用的所选答案的变体,请参阅下文。 This is in a Visibility expression, but should be easily ported to a Filter expression by setting Expression type to Boolean and comparing if Expression = True : 这是一个Visibility表达式,但是应该通过将Expression类型设置为Boolean并比较Expression = True来轻松移植到Filter表达式:

=IIf(InStr("unwanted values here", Fields!fieldToCheck.Value), True, False)

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM