Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Hi,
I have produced a pie chart that uses a Traffic Lighting system ie Red = High Risk, Amber = Medium Risk and Green = Low Risk.
The pie chart shows the data I require, however the colours are not consistent with the variables ie 'Red' = Green, 'Amber' = Red and 'Green' = Blue
I thought I could add the following expression to resolve this issue, but it doesn't seem to work:
if(TRAFFIC_LIGHTING='Red',rgb(220,20,60),if(TRAFFIC_LIGHTING='Amber',rgb(255,97,3),if(TRAFFIC_LIGHTING='Green',rgb(0,255,0))
I would really appreciate any ideas as to how to code this in the expressions tab.
Regards,
Daniel
Could you please post your example?
Hi,
Thank you for your response, unfortunately I am unable to post the example as it contains the company trading data.
A sample is attached below:
TRADE_NUM TRAFFIC_LIGHTING
7893897 Red
7893360 Amber
7893359 Red
7893355 Green
7893871 Red
7893870 Amber
7893861 Green
7893918 Red
I then create a pie chart:
Count(TRADE_NUM)
Dimensions TRAFFIC_LIGHTING
The pie chart shows Green as segment colour blue, Amber as segment colour red and Red as segment colour green.
Hope the above makes sense.
Regards,
Daniel
Hi, look at the proprierties of the expression (click on )
What about the answer I sent to you? Is it helpful?
Hi,
Thanks again for your reply.
Unfortunately I am on the personal edition of Qlikview at the moment.
Would it be possible to post the code on here?
Thanks for your help.
Regards,
Daniel
Hi,
Thanks again for your reply.
Unfortunately I am on the personal edition of Qlikview at the moment.
Would it be possible to post the code on here?
Thanks for your help.
Regards,
Daniel
the expression is correct, i,ve used the following code.
if
(TRAFFIC_LIGHTING='Red',rgb(255,0,0),
if(TRAFFIC_LIGHTING='Amber',rgb(255,97,3),RGB(0,255,0))
)
copy it in the background colour property for expression (click on the icon) and let me know the result.
Bye
Alessandro
Hi,
The pie chart now shows black for all the chart colours.
I added the the code to the following:
Expressions - Count(TRADE_NUM) - Background Color
I'm not sure where I can find the + icon you mention above.
Thanks,
Daniel