SSRS中的百分比计算

时间:2016-11-10 12:46:09

标签: reporting-services ssrs-2008

当我在 SSRS 2008

中计算时,如下所示
=SUM(IIF(Fields!REMARKS.Value = "GOOD",1,0))/((SUM(IIF(Fields!REMARKS.Value = "GOOD",1,0))+ SUM(IIF(Fields!REMARKS.Value = "BAD",1,0))))*100

getting result like 34.9632565235


but i am trying to get result like 34.97%

请分享您的专业知识。

由于

2 个答案:

答案 0 :(得分:0)

尝试:

=FORMAT(
SUM(IIF(Fields!REMARKS.Value = "GOOD",1,0))/
((SUM(IIF(Fields!REMARKS.Value = "GOOD",1,0)) +
SUM(IIF(Fields!REMARKS.Value = "BAD",1,0)))),"P2")

或者您可以使用自定义字符串格式:

=FORMAT(
    SUM(IIF(Fields!REMARKS.Value = "GOOD",1,0)) /
    ((SUM(IIF(Fields!REMARKS.Value = "GOOD",1,0)) +
    SUM(IIF(Fields!REMARKS.Value = "BAD",1,0)))*100)
,"0.00") & "%"

如果有帮助,请告诉我。

答案 1 :(得分:0)

您还可以在表达式中使用Round函数。使用此函数=ROUND(..., 1),您将在小数点后面有一个数字。如果要在小数点后面输入两个数字,则输入2,依此类推。 (所以你需要2)。

另请查看链接:Percentage SSRS

使用示例:

=Round(((SUM(Fields!FirstCallResolution.Value) / COUNT(Fields!CommunicationId.Value)) * 100),1)