Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Hi,
I would like to apply background color in a bar chart based on field values.
In the example attached, i have rgb values stored in a table for each product and i tried to apply those rgb values as background color of bars. I only have a good result when i perform a selection on a single product. When no selection is made QlikView doesn't seem to understand it.
Is there a way to achieve dynamic color based on those stored rgb values?
Thanks.
Hi,
I tend to think you should store the actual r, g, and b values as separate fields rather than the full string including the rgb() function call
The formula to get the background color would then be
=rgb(r,g,b)
You can simulate this on your own app as follows (the formula parses the "Couleur" string to find the r, g and b componants).
=rgb(textbetween(Couleur,'(',','),textbetween(Couleur,',',','),textbetween(Couleur,',',')') )
Hilaire
Since the variable shows what is selected, you need something more in the line of an if-statement or another formula (use the ASCII-code for each character for instance to calculate a colour).
See sample attached.
Hi,
I tend to think you should store the actual r, g, and b values as separate fields rather than the full string including the rgb() function call
The formula to get the background color would then be
=rgb(r,g,b)
You can simulate this on your own app as follows (the formula parses the "Couleur" string to find the r, g and b componants).
=rgb(textbetween(Couleur,'(',','),textbetween(Couleur,',',','),textbetween(Couleur,',',')') )
Hilaire
Ok. That's indeed perfectly working with separate fields R, G and B.
Thank you!