Qlik Community

New to Qlik Sense

Discussion board where members can get started with Qlik Sense.

Not applicable

Changing color by measure

Hi all, I have a problem where I want to change the color of the measures separately. Please see the chart below. I want to set all triangles as red if they are above the horizontal line and green if they are below the horizontal line. I want the color of the horizontal line to be red. Right now the line is green. My color expression is the following:

if(triangle>UpperLimit,red(),green())

You can see that the one red triangle below. The corresponding segment of the horizontal line is also red. How can I express the color so that the entire horizontal line is red, and that all triangles above the line is red and all triangles below it is green?

Thanks.

1 Solution

Accepted Solutions
Employee
Employee

Re: Changing color by measure

Hi Allen,

It's currently not possible to format color per measure, instead as you noticed the will share the same color.

It's an improvement we're looking at.

Best regards,

Patrik

11 Replies
praveenavelagap
Contributor III

Re: Changing color by measure

Background color of upperlimit as Red()

Not applicable

Re: Changing color by measure

Where would I set background color? Can you elaborate on your suggestion?

Employee
Employee

Re: Changing color by measure

Hi Allen, let me see if this is possible.

Hello plu - is this possible?

Please mark the appropriate replies as CORRECT / HELPFUL so our team and other members know that your question(s) has been answered to your satisfaction.

Regards,

Mike Tarallo

Qlik

Regards,
Mike Tarallo
Qlik
Employee
Employee

Re: Changing color by measure

Hi Allen,

It's currently not possible to format color per measure, instead as you noticed the will share the same color.

It's an improvement we're looking at.

Best regards,

Patrik

Not applicable

Re: Changing color by measure

Thanks for the response Patrick. Maybe also allow reference lines on Combo charts! This way I can just pick the color of the reference line instead of specifying a measure as the horizontal line.

Employee
Employee

Re: Changing color by measure

Yes, it's also an improvement we have. The difference here compared to other charts is that if you use one axis on each side it will be a bit trickier to draw the reference line without interrupting the axis values.

For this scenario, would not a bar chart work together with a reference line? You could color the bars depending on if they are above or below the reference line (which you could control the color of). Or is it a requirement that glyphs are used to represent the data?

Best regards,

Patrik

Not applicable

Re: Changing color by measure

Please do not use color expressions as that would not give you the desired result. Please test with the following steps:

1. Create a reference line in your chart from the 'Presentation' tab decide the line weight, color and style

2. Input the reference line expression as the desired value where you want the ref line to show

3. In the expression on the left menu select Background Color and in the 'Definition' input the following:

If( triangle> [Reference Line Expression] ,red(),green())

Ques.jpg

This should give you the desired results.

Not applicable

Re: Changing color by measure

It would be nice then to have the ability to specify which axis to anchor the reference line. But yeah I agree this will be pretty tricky to accomplish. I will leave the experts to that!

I have the bar chart with reference line I am just trying different visuals. Thanks Patrik.

Not applicable

Re: Changing color by measure

Allen,

We had a similar issue as yours and were able to get around it with the steps that I have suggested above.

Regards

SNC

Community Browser