Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
If, in my fact table, I have a unique ID field, a name, and a field called ColourRGB how do I use content of the field "ColourRGB" to specify the background colour of my Straight Table Chart?
ID | Name | ColourRGB |
---|---|---|
123||2|1 | Fred Blogs | |
123||3||2 | John Smith | RGB(250,0,0) |
214||99|12 | Ann Niting-Ale | |
513||16||1 | Wilma Karstart | RGB(0,248,0) |
114||7|8 | Ray Dargunn |
I would like the background colour of the 2nd row to be red as specified by RGB(250,0,0) and the 4th row to be green - RGB(0,248,0)
I have tried various expressions in "Background Color" of each field -
$(=ColourRGB)
if(IsNull(ColourRGB),RGB(255,255,255),$(=ColourRGB))
if(len(ColourRGB)=0, RGB(255,255,255),$(=ColourRGB))
if(IsNull(ColourRGB),RGB(255,255,255),RGB(250,0,0))
Obviously the fourth attempt coloured the 2nd row red but, of course, the 4th was red also - this is what I would expect. But, how do I get it to use the content of the field ColourRGB instead?
Incidentally, the background colour does get coloured appropriately when I click on the ID of the row concerned filtering the table to just one record.
The end result should look like this:
ID | Name | ColourRGB |
---|---|---|
123||2|1 | Fred Blogs | |
123||3||2 | John Smith | RGB(250,0,0) |
214||99|12 | Ann Niting-Ale | |
513||16||1 | Wilma Karstart | RGB(0,248,0) |
114||7|8 | Ray Dargunn |
I feel like I'm nearly there, just not quite got it right.
$ sign expansion is evaluated at chart level, so not at row level for each value in the dimension. Instead of loading rgb(250,0,0), load three fields e.g. r,g,b and use the background color expression
=rgb(r,g, b)
$ sign expansion is evaluated at chart level, so not at row level for each value in the dimension. Instead of loading rgb(250,0,0), load three fields e.g. r,g,b and use the background color expression
=rgb(r,g, b)
See attached example
Excellent! Thanks Stigchel, that worked perfectly.
You're welcome