COGNOiSe.com - The IBM Cognos Community

IBM Cognos 10 Platform => Cognos 10 BI => Report Studio => Topic started by: Enrique on 30 Aug 2016 09:46:55 AM

Title: How to dynamically set color intervals in a Bar Chart
Post by: Enrique on 30 Aug 2016 09:46:55 AM
Hi does anyones knows how could i set dynamically intervals in a Bar Chart

The requirement is to obtain the boundary values(Gauge Axis Colors) of red, amber and green colors.

it is that possible?

With "Conditional Palette" you can set the color of all Bars with a condition, but its not what i m looking for.

I would like that the Bar change dinamically.

see Attach.


Thanks in advance, Enrique
Title: Re: How to dynamically set color intervals in a Bar Chart
Post by: hespora on 31 Aug 2016 03:16:31 AM
The only way I got this to work is a hack... you take apart your ratio into as many data items as you have colored regions (in my example, I chose 40 and 70 percent as the borders):

first one:
if ([ratio] > 0.4)
then (0.4)
else ([ratio])


second one:
case
when [ratio] - 0.4 < 0 then 0
when [ratio] - 0.4 > 0.3 then 0.3
else [ratio] - 0.4
end


third one:
if ([ratio] - 0.7 < 0)
then (0)
else ([ratio] - 0.7)


Insert all three data items as series into a stacked column graph, format your series as you want, and done. See screenshot attached.