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: 
vicobi123
Contributor III
Contributor III

Colour by expression on single colours

I have a line chart with two expressions, is there a way I can colour each expression with two different single colours?

1 Solution

Accepted Solutions
vicobi123
Contributor III
Contributor III
Author

Thanks Taj, this is the answer.

You have to be using Qlik Sense 3.2 (if not, please upgrade)to be able to affect color to master measures:

Below, I'll be creating 2 master measures: sum("car sales") and sum("commercial vehicle sales"):

Capture.PNG

Capture.PNG

View solution in original post

10 Replies
tajmohamed30
Creator III
Creator III

on the expression background color you can try like

=if(sum(Sales)>=5000,Green(),if(sum(Sales)<=4999,Red()))

vicobi123
Contributor III
Contributor III
Author

Hi Taj, that's not what i want to do. I have two expression:

1. Sum([Home Yellow]) + Sum([Away Yellow])

2. Sum([Home Red])+Sum([Away Red])

I want to colour the first expression as yellow and second expression as red. Now i've tried

if((Sum([Home Yellow]) + Sum([Away Yellow])), rgb (255,0,0), if((Sum([Home Red])+Sum([Away Red])),rgb (0,255,0)))

I've also tried

if((Sum([Home Yellow]) + Sum([Away Yellow]))=(Sum([Home Yellow]) + Sum([Away Yellow])),yellow(),if((Sum([Home Red])+Sum([Away Red]))<=(Sum([Home Red])+Sum([Away Red])),Red()))

They both don't work.

Regards,

Vic

tajmohamed30
Creator III
Creator III

on the properties>colors tab, you can change colour 1 and 2 and also you have the option to define rgb values

micheledenardi
Specialist II
Specialist II

On expression background set:

rgb (255,0,0) //(for Sum([Home Yellow]) + Sum([Away Yellow]) expression)

rgb (0,255,0) //(for Sum([Home Red])+Sum([Away Red]) expression )

qlikview-expression-properties.png


Michele De Nardi
If a post helps to resolve your issue, please accept it as a Solution.
vicobi123
Contributor III
Contributor III
Author

This is on Qliksense btw

vicobi123
Contributor III
Contributor III
Author

This Qlikview, i'm talking about the ability to do this on Qliksense

micheledenardi
Specialist II
Specialist II

Create a dimension using valuelist(),

Valuelist('Home Yellow + Away Yellow','Home Red + Away Red')

then create 1 expression:

1. if(rowno()=1,

          Sum([Home Yellow]) + Sum([Away Yellow]),

          Sum([Home Red])+Sum([Away Red])

     )

then under "Aspect->Colors" use "color by expression" and write:

if(rowno()=1,rgb (255,0,0),rgb (0,255,0))

Michele De Nardi
If a post helps to resolve your issue, please accept it as a Solution.
vicobi123
Contributor III
Contributor III
Author

Hi, it's a line chart and the only dimension is 'Months'. How will creating a valuelist dimension solve this?