SSRS表达式

时间:2012-03-07 06:31:20

标签: reporting-services ssrs-2008 ssrs-tablix

我需要在 tablix 中实现以下表达式:

1。NewReatil < cost then " NR is below cost"

2。% Change >=20% then " NR is >=20%"

此处%change 是派生列。

我试过了:

=Switch(Fields!NEW_RETAIL.Value < Fields!PC.Value, "New Retail is below cost", ReportItems!Change.Value >= 20%, "New retail is >=20%")

=IIF(Fields!NEW_RETAIL.Value < Fields!PC.Value, "New Retail is below cost", IIF(ReportItems!Change.Value >= 20%, "New retail is >=20%")," ")

但两者都不起作用!

尽快帮助!!

1 个答案:

答案 0 :(得分:0)

“20%”是字符串,表达式“&gt; 20%”实际上没有意义(即使它确实有,20%是什么?)

尝试

 =IIF(
   Fields!NEW_RETAIL.Value < Fields!PC.Value, "New Retail is below cost",
  IIF(ReportItems!Change.Value >= 20, "New retail is >=20%"," "))

检查ReportItems!Change.Value中是否有数字。 (它可能被格式化为带有文本框格式的百分比,但该值仍应为数字,而不是最后带有“%”的字符串。