COGNOiSe.com - The IBM Cognos Community

IBM Cognos 8 Platform => COGNOS 8 => Topic started by: dxwallace on 09 Jul 2007 06:36:43 PM

Title: [RS] Does cognos aggregate after or before rolling up
Post by: dxwallace on 09 Jul 2007 06:36:43 PM
I never seem to get a definitive answer to this basic question, but if you have a calculation   (a * b) / c   does cognos roll up the data and then perform the calculation, or is the calculation performed on each detail line first and then rollup?
Title: Re: [RS] Does cognos aggregate after or before rolling up
Post by: blom0344 on 10 Jul 2007 01:48:07 PM
IMHO performing a roll-up before performing the calculation would yield incorrect results in any case.

Example:

A             B            C          (A*B/C)

10           10          5            20
3            200        60           10
100        50         500          10
                                          ____
                                           40

Now a roll-up would be : (113*260/565 = 52)

But perhaps I am missing your point?
Title: Re: [RS] Does cognos aggregate after or before rolling up
Post by: dxwallace on 11 Jul 2007 03:18:18 PM
You have the point, I was finding my way through all the Aggregate and Rollup functionality.

Total, Calculate, Summary, Count and so on. I was getting some weird results in a report, so I had to start from scratch and see how cognos is calculating the data.
Title: Re: [RS] Does cognos aggregate after or before rolling up
Post by: goose on 21 Jul 2007 05:03:39 PM
it depends on the aggeration type set for the data item. In your example if the aggeration type was set to total like blom0344 said you would get the incorrect result. But if you set the aggeration type to aggregate cognos would rollup the values first and then perform bomdas giving you the correct result.