COGNOiSe.com - The IBM Cognos Community

IBM Cognos 10 Platform => Cognos 10 BI => Report Studio => Topic started by: gosoccer on 13 Feb 2017 09:42:17 AM

Title: Not showing accurate percentages in Report (Relational)
Post by: gosoccer on 13 Feb 2017 09:42:17 AM
Hi and good morning,  :)

Please see attached, My percentages are showing goofy.

The calculation for coming up with the percentages is as following
in my Framework Manager.

Column B+Column C/Column D+Column F+Column H
So,  the # of BMWs roll from Last Month+Brand New BMW/Fixed+Needs Repair+Towed

In my Framework Manager Subject Query Calculation, here is what I have:

BMW_TOT_WORK Calculation in the Subject Query of the Framework Manager is,

If ([Physical View].[CAR_CD] ='BMW') THEN
([Physical View].[TOT_# of BMWs roll from Last Month]+[Physical View].[Brand New BMW]) /[Physical View].[TOT_WORK] 
else
(0)

After moving all to Presentation View

Now, in my Report Studio, I have the following,

percentage([Presentation View].[BMW_TOT_WORK])

Thanks for your time.
Title: Re: Not showing accurate percentages in Report (Relational)
Post by: gosoccer on 13 Feb 2017 09:45:06 AM
Especially for:

November   12   1   1   20%   4   19%   1   19%

Shown in the Mockup.

Not sure how I'm getting 20% for % of Fixed.

Thanks a lot

Title: Re: Not showing accurate percentages in Report (Relational)
Post by: gosoccer on 13 Feb 2017 09:49:28 AM
One more explanation: :) :)

In the Report Studio, the Aggregation and Roll Up Functions are set to Automatic for the percentage([Presentation View].[BMW_TOT_WORK]) Data Item.

Thanks
Title: Re: Not showing accurate percentages in Report (Relational)
Post by: AnalyticsWithJay on 13 Feb 2017 10:33:58 AM
Hi,

You're not using the percentage() function correctly. It was designed to calculate the value of the current measure as a percentage of the total value for that measure. As such, it's returning the correct percentages according to its definition.

As for your problem, you need to set the aggregation to 'Calculated' and remove the percentage function. You need to change the Data Format property on the data item to Percent.

Jay
Title: Re: Not showing accurate percentages in Report (Relational)
Post by: gosoccer on 13 Feb 2017 10:50:56 AM
Thanks Jay. I'll try it this afternoon.  :)