Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Hi,
I'm trying to assign dynamic background colours, but
=Red(Score*255)
won't work. I tried
=if(Score>0.5,Red(255),Red(50))
and that's fine, but surely I don't need to have 50 if statements to get more shades of Red?
Thanks!
Oli
Are you trying to dynamically change the colors in a table based on the cell value vs a standard? If so, click the "+" next to your expression and select background color, then enter your expression to define the behavior.
Then you'd have one if statement for your whole table
I'm doing exactly that. That's not the problem though - the problem is that =Red(Score*255) doesn't work and I don't want to give 255 if statements for every shade of red. Score=1 should be Red(255), Score=0 should be Red(0), but QlikView can't cope with calculations in Red() apparently.
See this post http://community.qlik.com/blogs/qlikviewdesignblog/2012/12/04/colors-in-charts
You'll want to basically make a color definition table based on the score.
Try using the colormix wizard.
Use instead
=RGB(Score*255,0,0)
Eduardo
As Jacob Kean says, Use colormix wizard,
Go to the background color of your expression, then go to File in the upper left hand corner and choose Colormix Wizard..., then put the expression in (such as Score) then choose the upper and lower limit color. Finish the wizard and it will spit out a formula that should shade your backgrounds.
Hope this helps!
EDIT: Attached is an example using Colormix wizard
Thank you! Surely that's a bug that needs fixing...
Yes, I would also use an RGB expression instead, and assure the (Score x 255) returns values between 1 and 255.
The red(x) does not actually give shades of red, but red with different alpha values/different oppacities which might give a slightly different result.
If Score has more than one value per line/bar etc., you will probably end up with black lines/bars, if you don't take care of this in the calculation.