如何比较不同数据集中的两个相同字段

时间:2016-07-19 15:37:57

标签: reporting-services fetchxml

我有这两个数据集

  • 已购买的类别,其中显示了客户从
  • 购买的类别
  • 所有类别,这是所有项目类别

enter image description here

enter image description here

我想要做的是比较类别购买 psd_parentproductcategoryid并将其与所有类别 psd_parentproductcategoryid进行比较,以获取未出现在分类购买结果

我使用的是FetchXML,而不是SQL。

1 个答案:

答案 0 :(得分:1)

您应该可以使用查找:

=lookup(Fields!psd_parentproductcategoryid.Value,Fields!psd_parentproductcategoryid.Value.Value, Fields!psd_parentproductcategoryid.Value, "AllCategories")

过滤器部件可能很棘手。我无法找到我的榜样,但有一种方法。希望这至少可以让你开始。

**修改

我有一个名为Present的参数。我想要过滤数据集时传递的值是0.

以下是tablix上的过滤器代码:

=iif(Parameters!Present.Value = 0 , lookup(Fields!psd_parentproductcategoryid.Value,Fields!psd_parentproductcategoryid.Value.Value, Fields!psd_parentproductcategoryid.Value, "AllCategories") is nothing, "FALSE", "TRUE"), "TRUE")

**编辑2 您可以将其添加到过滤器,只返回其他数据集中不存在的值。

IIF(=lookup(Fields!psd_parentproductcategoryid.Value,Fields!psd_parentproductcategoryid.Value.Value, Fields!psd_parentproductcategoryid.Value, "AllCategories") is nothing, Fields!psd_parentproductcategoryid.Value, nothing)
相关问题