SSRS 表达式 - 当一组是参数时减去总和
我试图在 SSRS 报告中减去两个场景。一种场景是常量“实际值”,另一种场景是动态预测场景并由参数设置。这是我正在尝试的代码:
=sum(iif(Fields!Scenario_Name.Value=Parameters!ScenarioName.Value,CDbl(Fields!CAD.Value),0))-
sum(iif(Fields!Scenario_Name.Value="Activity Actuals",CDbl(Fields!CAD.Value),0))
我也尝试过:
=sum(iif(Fields!Scenario_Name.Value=Parameters!ScenarioName.Value,Fields!CAD.Value,0))-
sum(iif(Fields!Scenario_Name.Value="Activity Actuals",Fields!CAD.Value,0))
报告运行,但在输入此表达式的行中出现错误。
I am trying to Subtract two scenarios from each other in a SSRS report. One scenario is a constant, 'Actuals' the other is a dynamic forecast scenario and set by a parameter. Here is the code I am trying:
=sum(iif(Fields!Scenario_Name.Value=Parameters!ScenarioName.Value,CDbl(Fields!CAD.Value),0))-
sum(iif(Fields!Scenario_Name.Value="Activity Actuals",CDbl(Fields!CAD.Value),0))
I have also tried:
=sum(iif(Fields!Scenario_Name.Value=Parameters!ScenarioName.Value,Fields!CAD.Value,0))-
sum(iif(Fields!Scenario_Name.Value="Activity Actuals",Fields!CAD.Value,0))
The report runs but I get an error in the line where this expression is entered.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
CDEC 对于 CAD.value 和 0 都很重要。参数值需要 (0),就像在最终有效的表达式中一样。
Sum(iif(Fields!Scenario_Name.Value="活动实际值",CDEC(Fields!CAD.Value),CDEC(0)))
The CDEC was important to both the CAD.value and the 0. The Parameter value needs a (0) as in the final expression that works.
Sum(iif(Fields!Scenario_Name.Value="Activity Actuals",CDEC(Fields!CAD.Value),CDEC(0)))