Do not input private or sensitive data. View Qlik Privacy & Cookie Policy.
Skip to main content

Announcements
Qlik Open Lakehouse is Now Generally Available! Discover the key highlights and partner resources here.
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

Assign color groups 7-12, 13-18 based on field value

Hi everyone,

I have a field, Project Name, that I am displaying in a graph and limiting to the top 20 values. Is there a way I can specify that field values beginning with "ABC..." should be assigned colors 7-12, and values beginning with "DEF..." should be assigned colors 13-18?

Thanks!

1 Solution

Accepted Solutions
JonnyPoole
Former Employee
Former Employee

I don't think so, unless you could design a calculated expression that defined a project name sort order that would place exactly  6 project names as the first 6, exactly 6 projects that begin with ABC as the next 6 and exactly 6 projects that begin with DEF as the next 6 after that.

That seems to put a lot of constraints to be practical . 

Another perhaps better way would be to put the RGB color code as 1 or 3 attribute fields of project name in the data model...perhaps as a mapping load and then the background color could reference this field(s).

View solution in original post

4 Replies
jagan
Partner - Champion III
Partner - Champion III

Hi,

Try like this, you can specify colors to your dimension values like this

Chart Properties-> Expressions -> Click on expression -> Expand + icon -> Click on Background color -> and give expression like below

=Pick(Match(DimensionName, 'XYZ', 'ABC1',  'ABC2',  'ABC3',  'ABC4',  'ABC5', 'ABC6', 'DEF1', 'DEF2', 'DEF2'),

RGB(255, 0, 0), RGB(255, 122, 0),RGB(255, 122, 122),..................................................)

Hope this helps you.

Regards,

Jagan.

JonnyPoole
Former Employee
Former Employee

I don't think so, unless you could design a calculated expression that defined a project name sort order that would place exactly  6 project names as the first 6, exactly 6 projects that begin with ABC as the next 6 and exactly 6 projects that begin with DEF as the next 6 after that.

That seems to put a lot of constraints to be practical . 

Another perhaps better way would be to put the RGB color code as 1 or 3 attribute fields of project name in the data model...perhaps as a mapping load and then the background color could reference this field(s).

jagan
Partner - Champion III
Partner - Champion III

In addition to that check this thread

http://community.qlik.com/docs/DOC-6972

Hope it helps you

Regards,

Jagan.

Not applicable
Author

Thanks so much Jon. The first method would indeed be impractical, I like the second idea better. I may post a new question later on asking how to do this, if I cannot figure this out myself