Warning: file_get_contents(/data/phpspider/zhask/data//catemap/8/logging/2.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Reporting services 将百分比添加到行末尾的SSR_Reporting Services_Ssrs 2008 R2 - Fatal编程技术网

Reporting services 将百分比添加到行末尾的SSR

Reporting services 将百分比添加到行末尾的SSR,reporting-services,ssrs-2008-r2,Reporting Services,Ssrs 2008 R2,所以我有一份报告是这样的 我试图在最后一列中添加一个百分比,其工作方式与当前总数的工作方式相同。例如,我希望看到的电子邮件总数为88%(总类型,214封电子邮件除以244封)。我如何在SSRS中做到这一点?这是分组 基本上应该是这样的 =SWITCH ( Count(Fields!Customer.Value) = 0, 0 , True, Count(Fields!Customer.Value, "Type")/Count(Fields!Customer.Val

所以我有一份报告是这样的

我试图在最后一列中添加一个百分比,其工作方式与当前总数的工作方式相同。例如,我希望看到的电子邮件总数为88%(总类型,214封电子邮件除以244封)。我如何在SSRS中做到这一点?这是分组


基本上应该是这样的

=SWITCH (
        Count(Fields!Customer.Value) = 0, 0 ,
        True, Count(Fields!Customer.Value, "Type")/Count(Fields!Customer.Value, "Employee")
        )
我在这里使用SWITCH,因为它在满足第一个真实条件时停止求值,如果不满足,您可能会遇到被零除的问题

所以,我们说。。。。如果customer字段的计数为零,则只返回0,
True
就像
else
一样,它捕获任何以前的条件/结果对未捕获的内容。因此,如果我们需要计数,那么计算
类型
组中非空值的数量,然后除以员工级别(在
员工
组范围内)的非空值数量


不需要将结果乘以100,只需将单元格的格式设置为P0或P2或希望显示的小数位数。因此,在您的例子中,返回值将是0.87704,但将被格式化,假设您使用p1,作为“87.7%”

我认为它将是类似于=IIF(COUNT(Customer,“dsMain”)=0,0,COUNT(Customer,“Employee”)/COUNT(Customer,“dsMain”))的东西