Qlik Community

Qlik Sense App Development

Discussion board where members can learn more about Qlik Sense App Development and Usage.

acrodrigues03
New Contributor II

Color By Expression for one dimension

Hi All!

I have a pie chart only with one dimension that is:

=IF([Channel]='A','1',

IF([Channel]='B' or

[Channel]= 'C' or

[Channel]='D' ,

'2',

IF([Channel]='E' or

[Channel]= 'F' or

[Channel]='G' ,

'3',)))

So my pie chart has 3 sections: 1,2 and 3.

I want to define the colors for each section. How can I do that?

Thank you in advance!

Carina

5 Replies
acrodrigues03
New Contributor II

Re: Color By Expression for one dimension

I need to do this with set analysis

Re: Color By Expression for one dimension

You could create a Master Item using your Channel dimension and assigned colours to values :

https://help.qlik.com/en-US/sense/September2017/Subsystems/Hub/Content/Colors/assigning-colors-to-di...

acrodrigues03
New Contributor II

Re: Color By Expression for one dimension

Hi Bill!

Thank you for your fast response! Unfortunately I need to define them outside of the master items with set analysis

Re: Color By Expression for one dimension

In the properties panel go to:

  • Appearance
  • Colors abnd legengen
  • Colors:  Customs & By expression
  • For Expression

Use an expression something like

if ( equipment_owner = 'Leased' , green() , yellow() )


You can use whatever expression suits your needs.

lcontezini
Contributor

Re: Color By Expression for one dimension

Create the dimension in your script, then you colour your graph by expression, using the new dimension, like:

if(new_dimension=1,blue(),

if(new_dimension=2,green(),red()))

Community Browser