0
votes

I created this chart here: enter image description here

I add a new series in my chart with a value of 75 (green line).

I would like to show the green line in steps. I tried it with this expression here:

=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 ) ) ) ))

but this shows me an error

Too many arguments to 'Public Function IIf(Expression As Boolean, TruePart As Object, FalsePart As Object) As Object'

@AKM : I edited my expression now my chart looks like this:

enter image description here

1

1 Answers

1
votes

The error you get is because there's too many arguments, as said in the error.

The iif work like that :

IIF( CND , DWT , DWF )

  • CND = Condition, in your case : Fields!Datum.Value = "..."
  • DWT = Display When True, in your case : 75, 77 ...
  • DWF = Display When False, it's like the else statement, in your case : 0

Now look at your 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 ) ) ) ))

The construction of your iif is taking 4 arguments, which is incorrect :

IIF( CND , DWT , DWF , IIF(...) )

You must replace your DWF by your next IIF so it looks like

IIF( CND , DWT , IIF(...) )

What you are looking for must be :

=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)))))