COGNOiSe.com - The IBM Cognos Community

IBM Cognos 10 Platform => Cognos 10 BI => Report Studio => Topic started by: trcarr on 13 Nov 2012 11:39:57 AM

Title: Microchart bullet chart: Can "colored regions" have conditional colors?
Post by: trcarr on 13 Nov 2012 11:39:57 AM
I'm in Cognos 10.1.1 Report Studio, wanting to use a microchart bullet chart to depict percentage of sales towards a target using the familiar red / yellow / green traffic light colors.

I know how to create up to five colored regions, each with their own specified color, based on either fixed percentages or fixed numeric values.

Instead, we'd like a different variation of the bullet chart where there is just ONE colored region, and the color varies like this:

  a) if % of target < 90%, then colored region  = red
  b) if % of target >= 90% and < 96% then colored region = yellow
  c) if % of target >= 96% then colored region = green

I'm hoping that one way or another this is possible.  But I've checked the documentation, made numerous trials, and haven't been able to do it yet.

I'm a rookie with Cognos, so any suggestions will be greatly appreciated!

Thank you.
Title: Re: Microchart bullet chart: Can "colored regions" have conditional colors?
Post by: Bark on 14 Nov 2012 03:29:35 AM
So if I understand correctly, you want to create a scorecard adding a bullet (traffic light) to each of the regions to display their status, is that right?

If so, why don't you use an image with conditional source? upload the 3 traffic lights to your server and make the source of the image a data item expression. This data item will have your conditions with IF-THEN-ELSE and for each of them it will return an URL to the right image:

IF([% Target] < 0.9) THEN ('./traffic-red.jpg')
ELSE IF([% Target] > 0.96) THEN ('./traffic-green.jpg')
ELSE ('./traffic-amber.jpg')

Hope it helps.

Regards,

Bark
Title: Re: Microchart bullet chart: Can "colored regions" have conditional colors?
Post by: trcarr on 14 Nov 2012 01:39:50 PM
Thank you for your suggestion.  It's not quite what I envisioned, but I see how that would work. 

We'll probably implement an even simpler solution that merely displays the the relevant metric, i.e. percentage sales of target, in it's own cell, where the background is one of the traffic light colors.