Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 
ronman10
Creator
Creator

Combo Chart Conditional Colouring

Hello Guys,

 

I have created a combo chart with Months in the X-Axis (dimension). The  line shows month wise growth over previous year whereas the bars show us cumulative month wise growth eg; (Jan 18+Feb 18)/(Jan 17+Feb 17) and so on. Now, it is possible for one or more months to have month on month growth in +ve and cumulative in -ve and vice versa. As such, if month on month is +ve but cumulative is -ve, I would like the line to show up in green colour and bars in red and so on. Based on the value, the colour of the line and bar should change dynamically. Please advice on this.

 

Best Regards,

Rony

Labels (1)
5 Replies
ajaykakkar93
Specialist III
Specialist III

I think you can do it with master measure, let me try & get back to you

Please mark the correct replies as Solution. Regards, ARK
Profile| GitHub|YouTube|Extension|Mashup|Qlik API|Qlik NPrinting

ronman10
Creator
Creator
Author

Hi Ajay,

 

Any updates on this. I tried master measure but was unable to get it to work. Below is the formula I tried:

=if(Sum({<[YearMonth.autoCalendar.Year]={"$(=Year(Max([YearMonth.autoCalendar.Year]))-1)"}>}Value)/
Sum({<[YearMonth.autoCalendar.Year]={"$(=Year(Max([YearMonth.autoCalendar.Year]))-2)"}>}Value)-1<=0.00,lightred(),green()) and

if(Sum({<[YearMonth.autoCalendar.Year] = {"$(=Year(Max([YearMonth.autoCalendar.Year]))-1)"}>}
Aggr(RangeSum(Above(Sum({<[YearMonth.autoCalendar.Year]>}Value), 0, Only({1}[YearMonth.autoCalendar.Month]))), YearMonth))/

Sum({<[YearMonth.autoCalendar.Year] = {"$(=Year(Max([YearMonth.autoCalendar.Year]))-2)"}>}
Aggr(RangeSum(Above(Sum({<[YearMonth.autoCalendar.Year]>}Value), 0, Only({1}[YearMonth.autoCalendar.Month]))), YearMonth)) - 1<=0.00,lightred(),green())

 

Text in red is month on month whereas dark blue is cumulative month on month. Any advice?

Regards,

Rony

ajaykakkar93
Specialist III
Specialist III

Hi,

As I can see here,

Let's take a single line you need 2 colour (in single line) based on value plot.

If +iv then green & -iv then red.?

Please mark the correct replies as Solution. Regards, ARK
Profile| GitHub|YouTube|Extension|Mashup|Qlik API|Qlik NPrinting

ajaykakkar93
Specialist III
Specialist III

Is this what you need 

Click on below link

https://encrypted-tbn0.gstatic.com/images?q=tbn%3AANd9GcS869BXEyDh4ayK5YQzqG0dWkF0dPm6uGeuPnS_wfQhps...

Please mark the correct replies as Solution. Regards, ARK
Profile| GitHub|YouTube|Extension|Mashup|Qlik API|Qlik NPrinting

ronman10
Creator
Creator
Author

Hi Ajay,

 

Attached image shows my requirement. If you notice the line in the month of July, it is being shown as red(-)ve even though the value is a (+)ve. Same issue with September where the value is (-)ve but the line is being shown in green. I want the conditional colouring formula to be applied to both the measures i.e, month on month (Bar) and cumulative month on month (line) so that the colour of the line and bar change dynamically as and I when I make selections. Please advise.

Regards,

Rony