[英]SSRS Report Builder Aging Buckets
I'm trying to create an aging report for customers by sales person. 我正在尝试为销售人员创建一份老化的报告。 I have customer groups, then all the customers in that group.
我有客户群,然后是该群组中的所有客户。 I'm trying to calculate the sum of money due by aging buckets of <30, Between 31 and 60, between 61 and 90, and >90.
我正在尝试计算由于老化水桶<30,在31到60之间,在61到90之间,以及> 90之间的金额。
My SQL view calculates the age of the bill in the table as OverDueDays , and the total of the bill as AmountDC . 我的SQL视图计算表中账单的年龄为OverDueDays ,以及账单总额为AmountDC 。
I came up with the following for the <30 bucket, but it's not displaying the correct values. 我为<30桶提出了以下内容,但它没有显示正确的值。
=IIF(Fields!OverDueDays.Value<30 , Sum(Fields!AmountDC.Value),0)
Any ideas as to what I've done wrong? 关于我做错了什么的任何想法?
I haven't used Reporting Services in a while, so the syntax may not be 100% correct. 我暂时没有使用Reporting Services,因此语法可能不是100%正确。 Basically, you want to switch the order of your SUM and IIF.
基本上,您想要切换SUM和IIF的顺序。 Try something like:
尝试类似的东西:
=SUM(IIF(Fields!OverDueDays.Value < 30, Fields!AmountDC.Value, 0))
bonus: if you wanted to count the number of customers in a bucket: 奖金:如果你想计算一个桶中的客户数量:
=SUM(IIF(Fields!OverDueDays.Value < 30, 1, 0))
try the following expressions if you have multiple datasets: 如果您有多个数据集,请尝试以下表达式:
=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)
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.