COGNOiSe.com - The IBM Cognos Community

IBM Cognos 8 Platform => COGNOS 8 => Topic started by: cognosjon on 14 Jun 2007 09:27:29 AM

Title: Trend Line (RS]
Post by: cognosjon on 14 Jun 2007 09:27:29 AM
Surprisingly I have today been asked to provide a trend line on a few charts that we have in use, only surprised that the request has taken so long to come through :o.

I've scoured the Cognos KB on the best way/easiest way of achieving this and can find only one KB doc:1024310 that details the following and has a GO sales sample file with it:
his is possible using a linear fit which is a least squares regression line and is calculated as follows:

'Using N values of X and Y, and fitting the line to the expected Y' values for given X values we do the following

Y' = a + b*X

a = (Average(Y)*Total(X*X) - Average(X)*Total(X*Y))/(Total(X*X)-N*Average(X)*Average(X))

b = Total(X*Y) - N*Average(X)*Average(Y)/(Total(X*X)-N*Average(X)*Average(X))

Keep in mind that you have to group and summarize the individual data appropriately before doing these '


Does anyone use a different method of achieving this? ???

Any pointers would be helpful

Cognosjon
Title: Re: Trend Line (RS]
Post by: jguevin on 14 Jun 2007 01:56:20 PM
have you tried under properties for the chart...look in the Chart Annotations section, you could use the baseline feature to add a trend line.

hope this helps
Jeff
Title: Re: Trend Line (RS]
Post by: doremifasolasi on 27 Sep 2009 10:52:22 PM
Y' will be like this:

((total(minimum([X]*[Y] for [X]) for report)-total(minimum(1 for [X]) for report)*average(minimum([X] for [X]) for report)*average(total([Y] for [X]) for report))*[X] + (average(total([Y] for [X]) for report)*total(minimum([X]*[X] for [X]) for report)-average(minimum([X] for [X]) for report)*total(minimum([X]*[Y] for [X]) for report)))/(total(minimum([X]*[X] for [X]) for report)-total(minimum(1 for [X]) for report)*average( minimum([X] for [X]) for report )*average( minimum([X] for [X]) for report ))