0

我正在使用 SSRS 2014 SP1 x64 和 VS2013 Update 5。

我有以下表达式来尝试计算报表报告的老化。

=SUM(IIF(DateDiff("d", (Fields!OrderDate.Value, "Invoice"), Now())<=0, (Fields!LineAmount.Value, "Invoice"), 0))
=SUM(IIF(DateDiff("d", (Fields!OrderDate.Value, "Invoice"), now())>=1 and DateDiff("d", (Fields!OrderDate.Value, "Invoice"),Now())<=30, (Fields!LineAmount.Value, "Invoice"), 0))
=SUM(IIF(DateDiff("d", (Fields!OrderDate.Value, "Invoice"), now())>=31 and DateDiff("d", (Fields!OrderDate.Value, "Invoice"), Now())<=60, (Fields!LineAmount.Value, "Invoice"), 0))
=SUM(IIF(DateDiff("d", (Fields!OrderDate.Value, "Invoice"), now())>=61 and DateDiff("d", (Fields!OrderDate.Value, "Invoice"), Now())<=90, (Fields!LineAmount.Value, "Invoice"), 0))
=SUM(IIF(DateDiff("d", (Fields!OrderDate.Value, "Invoice"), now())>=91, (Fields!LineAmount.Value, "Invoice"), 0))

现在,当我尝试添加First到字段选择器时,我收到一条错误消息... uses a First, Last or Previous aggregate in an outer aggregate.

我究竟如何从发票数据集中引用这个字段(至少有两个数据集)?

我这样做正确吗?

4

2 回答 2

0

我相信以下方法会起作用:

=IIF(DateDiff("d", First(Fields!OrderDate.Value, "Invoice"), Now())<=0, RunningValue(Fields!LineAmount.Value, Sum, "Invoice"), 0)
=IIF(DateDiff("d", First(Fields!OrderDate.Value, "Invoice"), now())>=1 and DateDiff("d", First(Fields!OrderDate.Value, "Invoice"),Now())<=30, RunningValue(Fields!LineAmount.Value, Sum, "Invoice"), 0)
=IIF(DateDiff("d", First(Fields!OrderDate.Value, "Invoice"), now())>=31 and DateDiff("d", First(Fields!OrderDate.Value, "Invoice"),Now())<=60, RunningValue(Fields!LineAmount.Value, Sum, "Invoice"), 0)
=IIF(DateDiff("d", First(Fields!OrderDate.Value, "Invoice"), now())>=61 and DateDiff("d", First(Fields!OrderDate.Value, "Invoice"),Now())<=90, RunningValue(Fields!LineAmount.Value, Sum, "Invoice"), 0)
=IIF(DateDiff("d", First(Fields!OrderDate.Value, "Invoice"), now())>=91, RunningValue(Fields!LineAmount.Value, Sum, "Invoice"), 0)
于 2015-07-13T18:50:46.300 回答
0

您需要使用查找函数来引用第二个数据集中的字段

于 2015-07-13T08:12:17.370 回答