COGNOiSe.com - The IBM Cognos Community

IBM Cognos Analytics Platform => Cognos Analytics => Reporting => Topic started by: della12 on 06 Dec 2022 08:51:08 PM

Title: SQL based crosstab calculating columns instead of rows
Post by: della12 on 06 Dec 2022 08:51:08 PM
Hello everyone,

I have a Crosstab report that needs to calculate the percentage on each row separate, rather than column or entire crosstab.
All columns are perfect in the numbers, however when i convert it to percentage, it starts rendering the entire crosstab, rather than each row separate.

This is what i currently have:

            Timeline:     A               B                C              Totals
row 1                      5                                                  5%
row 2                                       94              1               95%
row 3                                                                          0%

This is what i am trying to achieve:


            Timeline:   A                  B              C            Totals
row 1                   33%             33%         33%          100%
row 2                   20%             60%         20%          100%
row 3                     0%             0%          100%         100%

The report is SQL based, im trying to figure out how to have the crosstab segment each row for the percentage.

Thank you,
Title: Re: SQL based crosstab calculating columns instead of rows
Post by: BigChris on 06 Jan 2023 02:24:05 AM
I might be missing something, but won't the the row percentage always add up to 100% in that situation?
Title: Re: SQL based crosstab calculating columns instead of rows
Post by: dougp on 06 Jan 2023 01:14:26 PM
I'm confused.  How do 5 and [blank] both become 33%?