COGNOiSe.com - The IBM Cognos Community

IBM Cognos 8 Platform => COGNOS 8 => Report Studio => Topic started by: cognosjon on 21 Apr 2009 02:14:05 AM

Title: Chart Calculations
Post by: cognosjon on 21 Apr 2009 02:14:05 AM
Morning all, I'm having some problems getting my head around a charting request that I have been presented with. Any help would be appreciated.

I have a simple chart.

X axis showing months of the year
Y axis showing revenue and target revenue.

I need to calculate the following conditions:

3 months in a row where the revenue is below target = Bad

and where

2 out of 3 months = Acceptable

To be honest I'm not sure where to start with this, each time I think of a starting position I think a few steps on and realise its a dead end.

Any help greatly appreciated.
Thanks

Title: Re: Chart Calculations
Post by: cognosjon on 22 Apr 2009 09:47:22 AM
Bit of an update I have used the following to help identify where the revenue is below target.
1 data item created that has an if statement that returns 1 when the revenue is below target and 0 if not.
A second data item with the the following calculation

moving-total([Data Item],3) This provides a count for the last three rows, so I can use it to identify three in a row.
However I'm now faced with what to do at the beginng of the year for the first two months and secondly I'm still baffled as to how I cancalculate when two out of three months are below the target level. ??? ???

Any ideas?

Title: Re: Chart Calculations
Post by: CognosPaul on 23 Apr 2009 04:10:48 AM
What is the data source? Dimensional or relational?
Title: Re: Chart Calculations
Post by: cognosjon on 23 Apr 2009 04:15:45 AM
Hi Paul,

Its relational but I think i may have cracked it.

for the two out of three months I'm using the calculation moving-total([Data Item],3 for report) between 2 and 3.
For the issue concerning the beginning of the year ensure that the query is not filtered by any date range. This then feeds a new query item whereby I filter the year that I wish to view with the correct counts returning.

A some what confusing post I will agree 100%