Do not input private or sensitive data. View Qlik Privacy & Cookie Policy.
Skip to main content

Announcements
Qlik Open Lakehouse is Now Generally Available! Discover the key highlights and partner resources here.
cancel
Showing results for 
Search instead for 
Did you mean: 
taha_mansoor
Creator
Creator

to use different colors for two measures using color by expression

Hi All

I have a case where I am using two measures in combo chart. Measure1 is Sales and Measure2 is Budget. My Sales values is going -ve in november month which I need to show as positive. My original chart looks like below:

taha_mansoor_0-1637048157791.png

 

I am using fabs() to make the -ve value +ve and using color by expression where I am using this expression: if(Sum(Sales)<0, Red, Blue()) and then my chart appears as below:

taha_mansoor_2-1637048912314.png

 

The problem here is that the Measure2 representation, i.e. line, also takes the impact of the color expression which I don't want. I want the budget line(Measure2) to be single color (yellow) as show in my original char above and Sale bars(Measure1) color to be dynamic based on the expression I have written in color by expression section.

Any idea how to control this? do I need to control via expression code or is there any feature that can help?

I can't go for color by measure using segments color definition inside the master measure because when I am defining the expression for my master measure I am already using fabs() in it to make the value positive, hence it will not get any -ve value at all, I believe.

I am using Qlik Sense Enterprise on Windows June 2020 version.

Thanks 

Taha

2 Replies
vinieme12
Champion III
Champion III

This feature was added in MAy 2021 version

https://help.qlik.com/en-US/sense-developer/November2021/Content/Sense_Helpsites/WhatsNew/What-is-ne...

Vineeth Pujari
If a post helps to resolve your issue, please accept it as a Solution.
taha_mansoor
Creator
Creator
Author

Alright. Is there any work around if upgrade is not an option for me.