我在图表中添加了一个新系列,其值为75(绿线)。
我想分步显示绿线。我在这里尝试了这个表达式:
=iif(Fields!Datum.Value = "2015-08-09 00:00:00",75,0, iif(Fields!Datum.Value = "2015-09-13 00:00:00",77,0, iif(Fields!Datum.Value = "2015-10-11 00:00:00",79,0, iif(Fields!Datum.Value = "2015-11-08 00:00:00",81,0, iif(Fields!Datum.Value = "2015-12-13 00:00:00",83,0 ) ) ) ))
但是这显示了一个错误
公共功能IIf的参数太多(表达式为布尔值, TruePart As Object,FalsePart As Object)As Object'
@AKM:我编辑了我的表达,现在我的图表看起来像这样:
答案 0 :(得分:1)
你得到的错误是因为错误中所说的参数太多了。
iif的工作方式如下:
IIF( CND , DWT , DWF )
现在看看你的iif:
=iif(Fields!Datum.Value = "2015-08-09 00:00:00",75,0, iif(Fields!Datum.Value = "2015-09-13 00:00:00",77,0, iif(Fields!Datum.Value = "2015-10-11 00:00:00",79,0, iif(Fields!Datum.Value = "2015-11-08 00:00:00",81,0, iif(Fields!Datum.Value = "2015-12-13 00:00:00",83,0 ) ) ) ))
你的iif构造有4个参数,这是不正确的:
IIF( CND , DWT , DWF ,IIF(...) )< / strong>
你必须用你的下一个IIF替换DWF才能看起来像
IIF( CND , DWT , IIF(...) )
您所寻找的必须是:
=IIF(Fields!Datum.Value = "2015-08-09 00:00:00", 75, IIF(Fields!Datum.Value = "2015-09-13 00:00:00", 77, IIF(Fields!Datum.Value = "2015-10-11 00:00:00", 79, IIF(Fields!Datum.Value = "2015-11-08 00:00:00", 81, IIF(Fields!Datum.Value = "2015-12-13 00:00:00", 83, 0)))))