Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 
NancyG
Contributor
Contributor

Expression Background Color based on Expression Name

I have a Dimension [ORG] that contains the different organization in my work area, one of them is HR.  I have an associated file that designates standard colors in RGB format that I use to designate colors in graphs for each organization.

When [ORG] is a dimension in the plot, and the expression like sum(hours), I use a series of if statements,  if([ORG]='HR', RGB(ORED,OGREEN,OBLUE), as the Background color expression to set the color for each [ORG].

My current quandary...  I'm setting the Expression label equal to Organization's name, e.g. HR,  each expression in the plot finds the number of people in that Organization, count({<ORG={'HR'}>}DISTINCT NAMES).      I'd like to keep the colors consistent with the plots using [ORG] as a dimension.  How can I link the Expression name, HR, to the color codes associated with  [ORG] = 'HR'

Thanks.

Labels (2)
2 Replies
kaushiknsolanki
Partner Ambassador/MVP
Partner Ambassador/MVP

HI,

You should use the Master Library to define colours for your dimension and measures.

https://help.qlik.com/en-US/sense/November2019/Subsystems/Hub/Content/Sense_Hub/Colors/assigning-col...

https://help.qlik.com/en-US/sense/November2019/Subsystems/Hub/Content/Sense_Hub/Colors/assigning-col...

 

Please remember to hit the 'Like' button and for helpful answers and resolutions, click on the 'Accept As Solution' button. Cheers!
Brett_Bleess
Former Employee
Former Employee

Here is a Design Blog post that may be another option:

https://community.qlik.com/t5/Qlik-Design-Blog/Colors-in-charts/ba-p/1475280

Regards,
Brett

To help users find verified answers, please do not forget to use the "Accept as Solution" button on any post(s) that helped you resolve your problem or question.
I now work a compressed schedule, Tuesday, Wednesday and Thursday, so those will be the days I will reply to any follow-up posts.