Skip to main content
Announcements
Have questions about Qlik Connect? Join us live on April 10th, at 11 AM ET: SIGN UP NOW
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

Ensure colours do not change in bar chart

I have an expression which defines the background colour for a bar chart I have

if(wildmatch(Market, 'EMEA*'), RGB(141,170,203),if(wildmatch(Market, 'APAC*'), RGB(252,115,98),RGB(187,216,84)))

It works well, until i start making selections in the Market field whereby the can bars change colour. Obviously I don't want that to happen, i want to colours defined above to stay fixed for each bar.

How do i do this?

1 Solution

Accepted Solutions
rubenmarin

Hi Alex, It's strange, if you salect a maket the bars it other markests should disappear and keep those in the selected market with the colors you set.

I guess your dimension is showing values that can be in mero than one market or you an using an expression with set analysis, in both cases, a selection will change the 'market' vaues for some dimension values and that causes to change the bar colors.

Try using something like:

if(wildmatch(Only({<Market>} Market), 'EMEA*'), RGB(141,170,203),if(wildmatch(Only({<Market>} Market), 'APAC*'), RGB(252,115,98),RGB(187,216,84)))

View solution in original post

11 Replies
Gysbert_Wassenaar

It seems to work fine here. Can you post a document that demonstrates the problem?


talk is cheap, supply exceeds demand
c_gilbert
Creator II
Creator II

Try checking 'Persistent Colors' in the 'Colors' tab of your chart properties.

nizamsha
Specialist II
Specialist II

In color tab->check the persistenct color

kji
Employee
Employee

Persistent colors should not have any effect if you are using a color expression.

Not applicable
Author

Johan is correct

Persistent colors has no effect if you are using a color expression.

Not applicable
Author

Persistent colors has no effect if you are using a color expression.

nizamsha
Specialist II
Specialist II

OOPS I forgot that Thanks for comment

Not applicable
Author

Try using

pick(match(market,'EMEA','APAC') , red() , rgb(215.215.166))

This is what I know the best expression for dynamic coloring.

stigchel
Partner - Master
Partner - Master

If I understand you correctly you're displaying a chart/table with results regardless of a selection in Market, however your color expression is not. If you want the color expression to have the same result regardless of a selection in market you need something like:

WildMatch(Concat({<Market=>} DISTINCT Market),'EMEA*')