I´m stuck on a color expression using a switch command.
I want to be able to set the color green if the following is true.
=Switch( Fields!direction.Value = "North" and (Fields!transport.Value = "Car" and Fields!units.Value >= 1) and (Fields!transport.Value = "Bike" and Fields!units.Value >= 2), "Green",
1=1, "Red"
)
Is it possible to use that many "and" in a switch statement? Is there a better way to write this code, maybe to include a iif statement?
You need to explain the conditions and the desired results to get a real answer but this might help you understand where the problem is..
Assuming you want to test if
Then the change is quite simple
All I did here was to make the transport/units check a single test with two conditions, if either (
OR
) is true then that part is True I Also replace the1=1
withTrue
but1=1
will work the same, they both returnTrue