Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

combo chart color measures by expression

i'm using a combo chart to display two measures.  the two measure expressions are:

sum(if([Availability woMW Severity]='Major',1,0))

sum(if([Availability woMW Severity]='Minor',1,0))

the resulting graph is:

ss 2015-11-25 at 5.35.33 PM.jpg

i need to assign a specific color to each line.  using the color by expression.  i tried a few iterations of the following, but it's not doing it for me.  any suggestions?

if("Availability woMW Severity"='Major',RGB(255,0,0),if("Availability woMW Severity"='Minor',RGB(255,165,0)))

is there a way to refer to a measure in an expression by using it's label, etc?  i.e. the two measures have labels "Major count" and "Minor count".  wondering if there's a function that allows something along the lines of if(MeasureLabel = "Major count",red,if(MeasureLabel = "Minor count",orange))

10 Replies
JonnyPoole
Employee
Employee

Not with 2 measures

BUT... you can add an extra dimension using a synthetic expression like this:

valuelist('Major SLA Violations Count','Minor SLA Violations Count')

Then remove both measures and create just one:

if(   valuelist('Major SLA Violations Count','Minor SLA Violations Count') = 'Major SLA Violations Count',

     sum(if([Availability woMW Severity]='Major',1,0)),

     if( valuelist('Major SLA Violations Count','Minor SLA Violations Count') = 'Minor SLA Violations Count',

               sum(if([Availability woMW Severity]='Minor',1,0))

     )

)

Then you can color by expression like this:

if(   valuelist('Major SLA Violations Count','Minor SLA Violations Count') = 'Major SLA Violations Count',

     red() ,

     if( valuelist('Major SLA Violations Count','Minor SLA Violations Count') = 'Minor SLA Violations Count',

               green()

     )

)

where red() and green() are valid color expressions in qlik

reddy-s
Master II
Master II

Hi Michal,

For an example on how to achieve this as Johathan mentioned check the attached QVF.

Capture.PNG

Capture1.PNG

Hope this helps!

-Sangram

Not applicable
Author

Thank you Jonathan, Sangram.

What you're suggesting works great for line chart, but unfortunately unless my understanding is incorrect, it does not work for combo charts.  combo charts do not allow multiple dimensions.  i need combo charts to display the data vs two different y-axis.  any idea how to implement a color measure by expression function for combo charts?

reddy-s
Master II
Master II

Hi Michal,

Its not possible to colour code a combo chart, the way its done in a line chart or a bar chart because of the dimension limit. As you cannot achieve this with a combo chart, I would prefer going for an extension or build one for your business requirement.

Not applicable
Author

thank you for the reply, but i would prefer the functionality is added to qlik sense.  seems like something that would be useful across the board.  should be as simple as measure a = color x, measure b = color y, etc.

JonnyPoole
Employee
Employee

This functionality will be added soon,  just not.right now.

Not applicable
Author

awsome.  thank you jonathan.

paul_scotchford
Specialist
Specialist

Hi Jonathan, and soon is really when ? Next release ? I know , it's commercial confidential, but as we use QlikSense more and more especially on the Enterprise side, there are so many features (us QlikView dev types) are used to that we are being asked to reproduce in QlikSense only to see disappointment in the requester's demeanor  when they are told pretty much that it's not available in QS or an extension.

A tad embarrassing when a power user says "Look I can do this easily in Excel (brr shiver) or Tableau etc" how does one reply besides the standard "Oh hopefully the next version will solve it"

Yes QS has a little way to go as far as competitive maturity is concerned, but users/developers want it sooner than later

Cheers

Paul

JonnyPoole
Employee
Employee

Thanks. i shared the feedback. Its not next month but is coming.

You did not find an extension to do this ?