You can do this several ways including changing texts and background colours but I think what you are after are the bundled images that mimic traffic lights.
Yes you need a chart of some sort (pivot or table) then create an expression like this :
if (fieldname='good', 'qmem://<bundled>/BuiltIn/led_g.png', if (fieldname='notsogood', 'qmem://<bundled>/BuiltIn/led_o.png', 'qmem://<bundled>/BuiltIn/led_o.png'))
This represents a compound conditional statement like this:
if fieldname = 'good' then
show green traffic light
else if fieldname = 'notsogood'
show orange traffic light
show red traffic light
Remember to change the 'display options' under the expressions tab on the'chart properties' to representation = 'image'.
Hope that helps,
I'd probably make your status field a dual() field:
dual(Status,match(Status,'ONTIME','NOTDELIVERED','LATE')) as Status
While you will still normally see Status as text, it then also has an underlying value of 1, 2 or 3. That allows you to set up a traffic light for the field just like you would for any other numeric field.
Hi John, I used the function you mentioned and for the first time got past 'Error in expression' message. Now, where do I put the Ontime = 1 and green traffic light, notdelivered = 2 and yellow traffic light and late= 3 red traffic light?
I put in Representaiton - Traffic Light Guage. Then go into Guage settings and don't know what to put here.
Can you please help? I've been on this all day.
See attached example. Basically, you put in the 1, 2 and 3 as the segment boundaries, and set the color for each segment appropriately.
testTrafficLightForText.qvw 112.2 K