4 Replies Latest reply: Mar 27, 2015 11:41 AM by Piet Hein van der Stigchel RSS

    Assign colour using value in data

    Lawrence Cooper


      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?

       

      IDNameColourRGB
      123||2|1Fred Blogs
      123||3||2John SmithRGB(250,0,0)
      214||99|12Ann Niting-Ale
      513||16||1Wilma KarstartRGB(0,248,0)
      114||7|8Ray 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:

      IDNameColourRGB
      123||2|1Fred Blogs
      123||3||2John SmithRGB(250,0,0)
      214||99|12Ann Niting-Ale
      513||16||1Wilma KarstartRGB(0,248,0)
      114||7|8Ray Dargunn

       

      I feel like I'm nearly there, just not quite got it right.