COGNOiSe.com - The IBM Cognos Community

IBM Cognos 10 Platform => Cognos 10 BI => Report Studio => Topic started by: MikeG on 06 Aug 2014 08:58:38 AM

Title: Sort in Crosstab not giving desired result
Post by: MikeG on 06 Aug 2014 08:58:38 AM
Hi,

I have written a crosstab as follows

                                                  Retail
                                                  Actuals
                                                  Current Month
Dealer Code   Region  Country

With a Period as the measure

When I sort it descending on  Column Current Month I get


Dealer code Region   UK                8
                               UK                7
                               UK                3
                      Germany                6
                      Germany                5

However I need the whole column sorted as one to give


Dealer code Region   UK                8
                               UK                7
                       Germany               6
                       Germany               5
                               UK                3

anybody any ideas ?
Title: Re: Sort in Crosstab not giving desired result
Post by: MFGF on 06 Aug 2014 09:09:11 AM
Quote from: MikeG on 06 Aug 2014 08:58:38 AM
Hi,

I have written a crosstab as follows

                                                  Retail
                                                  Actuals
                                                  Current Month
Dealer Code   Region  Country

With a Period as the measure

When I sort it descending on  Column Current Month I get


Dealer code Region   UK                8
                               UK                7
                               UK                3
                      Germany                6
                      Germany                5

However I need the whole column sorted as one to give


Dealer code Region   UK                8
                               UK                7
                       Germany               6
                       Germany               5
                               UK                3

anybody any ideas ?

Hi,

Sadly, that's not the way crosstabs work. Anything you use in row and column headings in a crosstab is automatically grouped, and there's nothing you can do to prevent this. Any sorts are therefore performed within the context of each group, which is what you are seeing.

My only suggestion is that you replace the crosstab with a list, and don't group the Country list item. You should then be able to sort in any way you desire.

Cheers!

MF.
Title: Re: Sort in Crosstab not giving desired result
Post by: MikeG on 07 Aug 2014 01:37:16 AM
Thanks for this,  Off to create a list report