COGNOiSe.com - The IBM Cognos Community

IBM Cognos Analytics Platform => Cognos Analytics => Reporting => Topic started by: HalfBloodPrince on 29 Oct 2019 04:53:59 AM

Title: How to show total percentage in summary of crosstab
Post by: HalfBloodPrince on 29 Oct 2019 04:53:59 AM
Hi Guys,

I am using cognos 11.0.13. I have cross tab report , I need to calculate  percentage and show the total in Summary lines of crosstab.
for example below is the expected output

Subject   Marks   Total   Percentage
maths   88   100   88%
Science   75   100   75%
English   65   100   65%
Total     228   300   76%

but i am getting the total of percentage in the Total
Subject   Marks   Total   Percentage
maths   88   100   88
Science   75   100   75
English   65   100   65
Total          228   300   228

is there any way to get the calculated percentage in summary ?

Title: Re: How to show total percentage in summary of crosstab
Post by: MFGF on 29 Oct 2019 07:43:29 AM
Quote from: HalfBloodPrince on 29 Oct 2019 04:53:59 AM
Hi Guys,

I am using cognos 11.0.13. I have cross tab report , I need to calculate  percentage and show the total in Summary lines of crosstab.
for example below is the expected output

Subject   Marks   Total   Percentage
maths   88   100   88%
Science   75   100   75%
English   65   100   65%
Total     228   300   76%

but i am getting the total of percentage in the Total
Subject   Marks   Total   Percentage
maths   88   100   88
Science   75   100   75
English   65   100   65
Total          228   300   228

is there any way to get the calculated percentage in summary ?

Hi,

Is the percentage being calculated within the report or is it an item your report is reading and rendering? If you're calculating it in the report, setting the aggregation type to Calculated should give you the correct result. If not, you're going to have to calculate it yourself for the summary.

Cheers!

MF.
Title: Re: How to show total percentage in summary of crosstab
Post by: BigChris on 29 Oct 2019 08:46:30 AM
Isn't there also something about the Solve Order for the percentage in the total row?
Title: Re: How to show total percentage in summary of crosstab
Post by: HalfBloodPrince on 29 Oct 2019 09:02:14 AM
I am calculating the columns at report level. I have tried setting the solve order to 2 for percentage column and both summary and detail aggregation to calculated. but still its showing the same resulted. Anything I am missing or setting incorrectly .

Thanks in advance.
Title: Re: How to show total percentage in summary of crosstab
Post by: MFGF on 29 Oct 2019 09:19:23 AM
Quote from: HalfBloodPrince on 29 Oct 2019 09:02:14 AM
I am calculating the columns at report level. I have tried setting the solve order to 2 for percentage column and both summary and detail aggregation to calculated. but still its showing the same resulted. Anything I am missing or setting incorrectly .

Thanks in advance.

Can you share the exact expression you are using?

MF.
Title: Re: How to show total percentage in summary of crosstab
Post by: HalfBloodPrince on 30 Oct 2019 01:16:58 AM
simple percentage calculation (total([A])/Total() )*100. Row wise its calculating the percentages correctly. but in summary line its showing total of calculated percentages.
Title: Re: How to show total percentage in summary of crosstab
Post by: MFGF on 30 Oct 2019 08:15:19 AM
Quote from: HalfBloodPrince on 30 Oct 2019 01:16:58 AM
simple percentage calculation (total([A])/Total() )*100. Row wise its calculating the percentages correctly. but in summary line its showing total of calculated percentages.

Hi,

Can you try changing the expression to

[Marks] / [Total]

Then use a percent format on the item in your crosstab?
Make sure the Summary Aggregation property for the item is set to Calculated
Then, in your crosstab, select the row edge, and use the Automatic summary option from the toolbar.

I just tried this with a simple report here and it works for me...

MF.
Title: Re: How to show total percentage in summary of crosstab
Post by: HalfBloodPrince on 31 Oct 2019 04:35:43 AM
Thanks MFGF. It worked . thanks once again .