2

I have a bar chart with some values and 2 dimensions. I put these 2 dimensions in a group.

Now I'd like to control the colors si I go in expression tab, click on the "+" and add a ondition for the background color.

enter image description here

This is the code I use to control the colors:

=if([Logo Fournisseur] = '2', RGB(215,146,93),
if([Logo Marque]='2', RGB(215,146,93),

if([Logo Fournisseur]='0',RGB(145,76,24),
if([Logo Marque]='0',RGB(145,76,24),

if([Logo Fournisseur]='1',RGB(182,109,53),
if([Logo Marque]='1',RGB(182,109,53),

))))))

It works BUT, when select the "2" value, and then I use the drill, all the values display in the drill are the color of the "2" value .(i.e. RGB(215,146,93) )

enter image description here

Can someone help me please? Sorry for my english, this is not my native language.

Verd'O
  • 101
  • 1
  • 10

1 Answers1

2

You need to use the getfield() function in the colour calculation.

 if(GetCurrentField([New Group])='Logo Fournisseur',
    if([Logo Fournisseur]='x',lightred(),lightblue()),
 if(GetCurrentField([New Group])='Logo Marque',
    if([Logo Marque]='b',lightred(),lightblue())))

The syntax checker will look like the expression is wrong but it should work. enter image description here

The Budac
  • 1,571
  • 1
  • 8
  • 10
  • Thanks for your answer. I have the same syntax checker and exactly the same expression and nothing appends. The only color is the default lightblue. – Verd'O Jun 30 '17 at 11:03
  • Pick($(='['&GetCurrentField(Logos)&']')+1, red(), blue(), Rgb(215,146,93)) This function works perfectly. Thanks again for your time. – Verd'O Jun 30 '17 at 14:41