0

我正在尝试按销售人员为客户创建一份老化报告。我有客户组,然后是该组中的所有客户。我正在尝试计算 <30、31 到 60 之间、61 到 90 之间以及 >90 的老化桶的应付金额。

我的 SQL 视图将表中账单的期限计算为OverDueDays,并将账单总额计算为AmountDC

我为 <30 桶提出了以下建议,但它没有显示正确的值。

=IIF(Fields!OverDueDays.Value<30 , Sum(Fields!AmountDC.Value),0)

关于我做错了什么有什么想法吗?

4

2 回答 2

2

我有一段时间没有使用 Reporting Services,所以语法可能不是 100% 正确。基本上,您想切换 SUM 和 IIF 的顺序。尝试类似:

=SUM(IIF(Fields!OverDueDays.Value < 30, Fields!AmountDC.Value, 0))

奖金:如果您想计算存储桶中的客户数量:

=SUM(IIF(Fields!OverDueDays.Value < 30, 1, 0))
于 2013-09-11T20:50:37.623 回答
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-14T14:39:48.363 回答