error : nested aggregation that specifies a dataset scope
error : nested aggregation that specifies a dataset scope
我一直在做ssrs,尝试做了下面的语句。我正在使用来自 2 个数据集的数据,我无法将它们合并为一个(我第一次遇到此错误时尝试过)。代码:
=Sum(iif(Fields!Year.Value = Max(Fields!Year.Value) - 1 , Sum(Fields!PersonCount.Value, "RetCust"), 0))
此代码给出错误:The Value expression for the text box has a nested aggregate that specifies a dataset scope. Inner aggregates cannot specify a dataset scope.
我还尝试了此代码的不同变体,如下所示:
=(iif(Fields!Year.Value = Max(Fields!Year.Value) - 1 , Sum(Fields!PersonCount.Value, "RetCust"), 0))
刚把开头的和去掉了。但是这次我有一个不同的错误:Report item expressions can only refer to fields within the current dataset scope or, if inside an aggregate, the specified dataset scope. Letters in the names of fields must use the correct case
希望有人能帮忙:)
干杯
你的表达有点不对
=Sum(iif(Fields!Year.Value = Max(Fields!Year.Value) - 1 , Sum(Fields!PersonCount.Value, "RetCust"), 0))
您的 Sum 在外面并且覆盖了不在同一数据集上的两个字段。您应该为它们中的每一个分配 Sum,因为它们来自不同的数据集。
试试这个:
=iif(Sum(Fields!Year.Value) = Max(Sum(Fields!Year.Value)) - 1 , Sum(Fields!PersonCount.Value, "RetCust"), 0)
注意:Max(Sum(....
我还没有测试过它是否正确。
我一直在做ssrs,尝试做了下面的语句。我正在使用来自 2 个数据集的数据,我无法将它们合并为一个(我第一次遇到此错误时尝试过)。代码:
=Sum(iif(Fields!Year.Value = Max(Fields!Year.Value) - 1 , Sum(Fields!PersonCount.Value, "RetCust"), 0))
此代码给出错误:The Value expression for the text box has a nested aggregate that specifies a dataset scope. Inner aggregates cannot specify a dataset scope.
我还尝试了此代码的不同变体,如下所示:
=(iif(Fields!Year.Value = Max(Fields!Year.Value) - 1 , Sum(Fields!PersonCount.Value, "RetCust"), 0))
刚把开头的和去掉了。但是这次我有一个不同的错误:Report item expressions can only refer to fields within the current dataset scope or, if inside an aggregate, the specified dataset scope. Letters in the names of fields must use the correct case
希望有人能帮忙:)
干杯
你的表达有点不对
=Sum(iif(Fields!Year.Value = Max(Fields!Year.Value) - 1 , Sum(Fields!PersonCount.Value, "RetCust"), 0))
您的 Sum 在外面并且覆盖了不在同一数据集上的两个字段。您应该为它们中的每一个分配 Sum,因为它们来自不同的数据集。
试试这个:
=iif(Sum(Fields!Year.Value) = Max(Sum(Fields!Year.Value)) - 1 , Sum(Fields!PersonCount.Value, "RetCust"), 0)
注意:Max(Sum(....
我还没有测试过它是否正确。