Qlik Community

QlikView Layout & Visualizations

Discussion Board for collaboration on QlikView Layout & Visualizations.

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

Re: Ensure colours do not change in bar chart

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)))

11 Replies

Re: Ensure colours do not change in bar chart

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


talk is cheap, supply exceeds demand
c_gilbert
Contributor II

Re: Ensure colours do not change in bar chart

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

nizamsha
Valued Contributor

Re: Ensure colours do not change in bar chart

In color tab->check the persistenct color

Employee
Employee

Re: Ensure colours do not change in bar chart

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

Not applicable

Re: Ensure colours do not change in bar chart

Johan is correct

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

Not applicable

Re: Ensure colours do not change in bar chart

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

nizamsha
Valued Contributor

Re: Ensure colours do not change in bar chart

OOPS I forgot that Thanks for comment

Not applicable

Re: Ensure colours do not change in bar chart

Try using

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

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

stigchel
Honored Contributor

Re: Ensure colours do not change in bar chart

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*')

Community Browser