Skip to main content
Announcements
Join us at Qlik Connect for 3 magical days of learning, networking,and inspiration! REGISTER TODAY and save!
cancel
Showing results for 
Search instead for 
Did you mean: 
manisha10
Contributor III
Contributor III

Colour measures in a Line Chart - Qlik Sense

Hi All,

I have a line chart with lines calculated with Measures. 

Measures are: sum(if (asset='A', Value/Total)), sum(if (asset='B', Value/Total)), sum(if (asset='C', Value/Total))

I want the lines to have a specific colour. A to be rgb(50,205,50), B to be rgb(255,0,0) and C to be rgb(0,128,128)

I wrote in color by expression (doesn't work): if( if(asset ='A', rgb(50,205,50), if(asset ='B', rgb(255,0,0),rgb(0,128,128))). 

Let me know if you know the solution! Thank you!

Qlik Sense Business Qlik Analytics Platform #Line Chart

2 Solutions

Accepted Solutions
lironbaram
Partner - Master III
Partner - Master III

Hi, 
If you'll use two dimensions in the chart, then you'll be able to define the colors for the different values in the "asset" field easily. 
check out the attached example 

View solution in original post

lironbaram
Partner - Master III
Partner - Master III

have you looked in the attached app, 
you define asset as a master measure and then you set the color for each value in the field 
please check the attached app 

View solution in original post

4 Replies
lironbaram
Partner - Master III
Partner - Master III

Hi, 
If you'll use two dimensions in the chart, then you'll be able to define the colors for the different values in the "asset" field easily. 
check out the attached example 

manisha10
Contributor III
Contributor III
Author

Hi  , 

I have two dimension in the line chart Asset and Date. 

I want specific colours for different asset categories A,B and C. 

lironbaram
Partner - Master III
Partner - Master III

have you looked in the attached app, 
you define asset as a master measure and then you set the color for each value in the field 
please check the attached app 

manisha10
Contributor III
Contributor III
Author

Thank you!! It is working now with your method of making it a master measure and assigning a colour to it! Thanks a lot