Qlik Community

New to QlikView

Discussion board where members can get started with QlikView.

Highlighted
josephinetedesc
Contributor III

How can I make all bars in graphs relating to a particular entity to be the same consistent color?

Hi say I have 4 people, John, Paul, George and Ringo and they are going to appear in a number of graphs.  How do I make sure that John's values always appear as a red bar in a graph, Paul as yellow, George as green and Ringo as purple.

I read that I can make an excel spreadsheet

with name     colour     rbg value

however I am not sure how to apply it.

Thank you for any help ...

1 Solution

Accepted Solutions
josephinetedesc
Contributor III

Re: How can I make all bars in graphs relating to a particular entity to be the same consistent color?

Worked beautifully - i wanted to use it as an excel sheet so that I could then add more people etc.

Interestingly I could not ope the file Test - probably due to licensing issues.

Thank you  I was going crazy

6 Replies
suheshreddy
New Contributor III

Re: How can I make all bars in graphs relating to a particular entity to be the same consistent color?

if you have small set of data you can add colors using if condition in background color

eg

if(people = John, rgb(255,200,255),

if(people = Paul, rgb(200,200,255),

if(people = George , rgb(255,200,20),if(people = Ringo , rgb(225,200,255))

else you can add excel file as

people  red      green      blue

John     200     225          200

Paul     225     200          225

George  200     225          225

you can link this table to your original table and you expression as rgb(red , green, blue) in background.

suheshreddy
New Contributor III

Re: How can I make all bars in graphs relating to a particular entity to be the same consistent color?

See the attached file for example.

Hope it works for you

Partner
Partner

Re: How can I make all bars in graphs relating to a particular entity to be the same consistent color?

Hi Josephine,

I would use variable for background. Something like

PICK(MATCH(Name,$(=chr(39) & Concat(Name,chr(39) &',' & chr(39)) & chr(39))),$(=Concat(Color,',')) )


PFA

Regars,

Sergey



Regards,
Sergey
josephinetedesc
Contributor III

Re: How can I make all bars in graphs relating to a particular entity to be the same consistent color?

Worked beautifully - i wanted to use it as an excel sheet so that I could then add more people etc.

Interestingly I could not ope the file Test - probably due to licensing issues.

Thank you  I was going crazy

josephinetedesc
Contributor III

Re: How can I make all bars in graphs relating to a particular entity to be the same consistent color?

Thank you!  Interstingly your file did open!

suheshreddy
New Contributor III

Re: How can I make all bars in graphs relating to a particular entity to be the same consistent color?

a:

LOAD * INLINE [

    People, sale

    George, 20

    John, 100

    rick, 200

    rock, 200

];

b:

LOAD * INLINE [

    People, Red, Green, Blue

    George, 250, 225, 250

    John, 255, 250, 225

    rick, 225, 250, 250

    rock, 3, 182, 182

];

this is the code i used in test.qvw instead of b inline table you can use it as excel file

Below is the code i used in my background color

Test.JPG.jpg