简体   繁体   English

SSRS Tablix过滤器可从1个数据集中排除数据(如果其不在数据集中2中)

[英]SSRS Tablix filter to exclude data from 1 dataset if its not in dataset 2

I am working on an report which has two slightly different data-sets (dataset 1 and dataset2). 我正在处理一个包含两个略有不同的数据集(数据集1和数据集2)的报告。 There are multiple tables within the report. 报告中有多个表。 For the tablix that is using dataset 1, I would like to add a filter that would exclude deals from dataset 1 that are not in dataset 2. The common Id for these datasets would be Dealid. 对于使用数据集1的Tablix,我想添加一个过滤器,该过滤器将排除数据集1中不在数据集2中的交易。这些数据集的通用ID为Dealid。

What would this Filter expression look like? 这个过滤器表达式是什么样的? Any help would be immensely appreciated. 任何帮助将不胜感激。

You can add a filter in your Dataset 1 or the Tablix and use the below expressions. 您可以在数据集1或Tablix中添加过滤器,并使用以下表达式。

在此处输入图片说明

In Expression entry box use: 在“ Expression输入框中,使用:

=IIF(
Isnothing(
Lookup(Fields!DealID.Value,Fields!DealID.Value,Fields!DealID.Value,"DataSet2")),
"Exclude","Include"
)

For the Value entry box use: 对于Value输入框,请使用:

="Include"

It will exclude the rows where DealID in dataset 1 aren't present in dataset 2. 它将排除数据集2中不存在DealID的行。

Let me know if this helps. 让我知道是否有帮助。

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

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