COGNOiSe.com - The IBM Cognos Community

IBM Cognos 8 Platform => COGNOS 8 => Report Studio => Topic started by: Chris_ on 20 Jul 2010 08:00:33 AM

Title: Chart query
Post by: Chris_ on 20 Jul 2010 08:00:33 AM
I've created a chart to display a number of different values between 0 and 50.  The data is based upon a selection made by the user on a prompt page.

However, when the number returned is low, in the example below both business units have had one promotion each - the chart would look like 5 due to the lines.

In this example, would it be possible to have only a line to indicate the one entry?

(http://www.upload3r.com/serve/200710/1279630426.jpg)

Regards, Chris.
Title: Re: Chart query
Post by: imts on 21 Jul 2010 06:29:41 AM
Chris - ur questn is not clear . Perhaps if u cud provide the screenshot how ur chart looks - it wud be helpful to provide a solution in that case.

-TS
Title: Re: Chart query
Post by: CognosPaul on 21 Jul 2010 06:52:11 AM
Imts, the screenshot is included, but it may be possible that you're blocked from seeing upload3r.com.

Chris, are the values always between 0 and 50? You could set the min/max values of the axis to 0/50, thus ensuring that the graph is always constant.

An alternate idea: Create a data item that returns the max value from the query. Drag a singleton to report and set that data item in the properties. Make a string variable that is something like:

case
  when [MaxValue] < 20 then 'Three'
  when [MaxValue] < 10 then 'Two'
  when [MaxValue] <  5 then 'One'
else 'default'
end

With 'Three', 'Two', 'One', 'default' as values in the variable.

Create a conditional block, set to that variable and put a copy of that graph in each block. In the 'Three' block, set the Scale Interval to 3, in the 'Two' block set it to 2, and in the 'default' block just leave it blank.

Now when the report is run it will first check the maximum value, and based on that return a graph that has an acceptable number of lines.
Title: Re: Chart query
Post by: Chris_ on 12 Aug 2010 04:49:12 AM
Thanks Paul - I set the maximum range for the chart and it's done the trick.  I run this report once a month so it's no hassle to adjust this property if required.