简体   繁体   English

SSRS 计数和表达式函数

[英]SSRS Count and Expression function

I am trying to count the number of packages which belong to the Area by using the count.我正在尝试使用计数来计算属于该区域的包裹数量。 Every Area has different number of Packages.每个区域都有不同数量的包裹。

How can I use Count here and check how many packages for a specific Area.我如何在此处使用 Count 并检查特定区域的包裹数量。 Also there is a attribute called 'Delivered' with defined values as D,N,P.还有一个名为“已交付”的属性,其定义的值为 D、N、P。 I want to check and calculate how much percentage of packages are in state 'D'.我想检查并计算处于“D”状态的包裹的百分比。

Can anyone help.任何人都可以帮忙。 I tried using the count but no luck.我尝试使用计数但没有运气。 =Count(Fields!Delivered.Value = 'D') =Count(Fields!Delivered.Value = 'D')

To get a count of specific records you can use something like this.要获取特定记录的计数,您可以使用这样的方法。

= SUM(Fields!Area.Value = "abc", 1, 0)

To get a percentage of the Delivered field do something like要获得已交付字段的百分比,请执行以下操作

=Sum(IIF(Fields!Delivered.Value = 1, 1, 0), "DataSet1")
 / Count(Fields!Delivered.Value , "DataSet1")

Make sure you change DataSet1 to match the dataset that the Delivered field comes form (you must include the quotes)确保更改 DataSet1 以匹配 Delivered 字段来自表单的数据集(您必须包括引号)

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM