COGNOiSe.com - The IBM Cognos Community

IBM Cognos 10 Platform => Cognos 10 BI => Report Studio => Topic started by: urreacp on 30 Jun 2016 12:08:00 PM

Title: Calculation Error with Singletons
Post by: urreacp on 30 Jun 2016 12:08:00 PM
I am having trouble with a report on a relational source.  I am trying to display several calculations on the report page using singletons, all calculations from the same query.  I need to calculate the amount of labs ordered per day by our organization, then calculate the percent change from 2015 to 2016.

2015: Labs per Day = Count of labs ordered / # days (both numbers calculated from their own data items with level of aggregation 'for report')

2016: Labs per Day = Count of labs ordered / # days (both numbers calculated from their own data items with level of aggregation 'for report')

Final calculation is: (2016 value - 2015 value) / 2015 Value

My issue is on the report page.  I have singletons displaying the 2016 Labs/Day value and the 2015 Labs/Day value, and they are both correct.  But the % calculation is always incorrect.  For instance, my 2016 value is 145, 2015 value is 137.  The % change is 5.84%, but I get something in neighborhood of 6.18%.  Many other similar calculations I have done have this same exact issue.

Any thoughts as to why this is happening? Does it have something to do with solve order?

Thanks in advance
Title: Re: Calculation Error with Singletons
Post by: AnalyticsWithJay on 30 Jun 2016 12:48:28 PM
Solve order is a dimensional function, particularly when dealing with charts and crosstabs.

Is the aggregate set to calculated? These type of relational issues are quite frequently caused by incorrect aggregation properties.
Title: Re: Calculation Error with Singletons
Post by: urreacp on 01 Jul 2016 08:44:01 AM
Thank you so much!  I set the final calculation data item aggregation to calculated, and I got the correct result.  Very helpful tip, I figured it was something small like that.