Reputation: 305
Here is a simplified version of what I'm trying to do through an expression.
if response_time > response goal
, "colour", but if response_time > response_goal * 0.25
, "colour#2"
Can this work through an expression?
At the beating my head against the wall stage...
Upvotes: 1
Views: 972
Reputation: 7218
I would refine this expression from Nick somewhat because the first condition would evaluate true even if the second condition is true. It would also be easier to read if you use the Switch function. So try something like this:
=Switch(response_time > response_goal and response_time <= response_goal * 0.25,"colour", response_time > response_time * 0.25, "colour#2")
UPDATE: Nick was right in order of operations - I was keyed in on the greater than sign and not the math operation. I still prefer the Switch function, but just to correct the record - the expression should look like this:
=Switch(response_time > response_goal 0.25 and response_time <= response_goal ,"colour#2", response_time > response_time, "colour")
Upvotes: 1
Reputation: 2847
I'm not completely aware of the order of operations that SSRS will use, but try wrapping the multiplied value in parenthesis.
IIf(response_time > response_goal, "colour", IIf(response_time > (response_goal * 0.25), "colour#2","default option"))
You'd want to change "default option" with whatever the expression should return if response_time
isn't greater than response_goal
or response_goal
* 0.25.
Upvotes: 1