【问题标题】:How do I calculate a percentage value from these two time values如何从这两个时间值计算百分比值
【发布时间】:2016-07-06 08:50:26
【问题描述】:

我有两个表达式正在计算多个数据集

表达式1如下:

=Format((count(Fields!Second_Choice_Options.Value, "Authorisation") * 20 + count(Fields!Second_Choice_Options.Value, "ClaimPaid") * 20 + count(Fields!Second_Choice_Options.Value, "ClaimPended") * 20 + count(Fields!Second_Choice_Options.Value, "General") * 8 +count(Fields!Second_Choice_Options.Value, "Reassesment") * 20 +count(Fields!Second_Choice_Options.Value, "ReserveReview") *3 +count(Fields !Second_Choice_Options.Value, "Trigger") *5 + Sum(Fields!ACD_Calls.Value, "DataSet3") * 6 + Sum(Fields!Extn_Out_Calls.Value, "DataSet3") * 2) / 60, "00") & ":" & Format(DateAdd("s", (count(Fields!Second_Choice_Options.Value, "Authorisation") * 20 + count(Fields!Second_Choice_Options.Value, "ClaimPaid") * 20 + count(Fields!Second_Choice_Options.Value , "ClaimPended") * 20 + count(Fields!Second_Choice_Options.Value, "General") * 8 +count(Fields!Second_Choice_Options.Value, "重新评估") * 20 +count(Fields!Second_Choice_Options.Value, "ReserveReview") *3 +count(Fields!Second_Choice_Options.Valu e, "触发器") *5 + Sum(Fields!ACD_Calls.Value, "DataSet3") * 6 + Sum(Fields!Extn_Out_Calls.Value, "DataSet3") * 2) * 60, "00:00"), " mm:ss")

时间值为71:45:00

然后我有第二个表达式是

=System.Math.Floor(Sum(Fields!Staffed_Time.Value) / 3600) - System.Math.Floor(Sum(Fields!Time_in_Lunch.Value) / 3600)- System.Math.Floor(Sum(Fields! Time_in_AUX_1099.Value) / 3600) & ":" & Microsoft.VisualBasic.Strings.Format(Microsoft.VisualBasic.DateAndTime.DateAdd("s", Sum(Fields!Staffed_Time.Value), "00:00"), "mm :ss")

时间值为156:39:22

因此,我需要在文本框中进行新的计算,并将 71:45:00 作为 156:39:22 的百分比,然后将其显示为百分比 - 即 45.5%

我该怎么做?

谢谢 丹

【问题讨论】:

    标签: reporting-services ssrs-2008


    【解决方案1】:

    不要使用返回格式化时间的两个表达式(即:70:17:00),而是返回分钟数的表达式(即:4217),因此您可以在 TextBox 中使用此公式将Format 属性设置为p2

    =[YourExpression1ToObtainMinutes]/[YourExpression2ToObtainMinutes]
    

    【讨论】:

    • 感谢您的回复 Tezzo - 我已在文本框中将格式属性编辑为 P2,但是当我将两个表达式分开时,它显示为错误 Dan
    • 也许我解释得不好(抱歉我的英语不好):您不必将返回格式化日期时间的两个表达式相除,而是返回分钟数的表达式(即不是返回 70:17:00 的表达式,而是返回 4217 的表达式。
    • 是的,现在更有意义了,非常感谢。考虑回答这个问题
    猜你喜欢
    • 1970-01-01
    • 2013-07-25
    • 1970-01-01
    • 1970-01-01
    • 2015-10-11
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多