COGNOiSe.com - The IBM Cognos Community

IBM Cognos Analytics Platform => Cognos Analytics => Reporting => Topic started by: peewan on 29 Jan 2020 11:12:32 AM

Title: Crosstab - Sort
Post by: peewan on 29 Jan 2020 11:12:32 AM
I'm using crosstab, and would like to sort my report.

Current:

          Male D   Female D   Female Sp      Female EE   Male EE   Male Sp   
0 to 18       7            5            0                1                      0                0            
19 to 26      1            1            1                1                      2                0            
27 to 29      1            1            1                1                      1                6

If I sort 'Gender' by A-Z; will be: Female EE\Female D\Female Sp\Male EE\Male D\Male Sp

I would like it: Male EE\Female EE\Male Sp\Female Sp\Male D\Female D

or at lease Male and female the same department go together.
Thank you
Title: Re: Crosstab - Sort
Post by: MFGF on 29 Jan 2020 12:50:34 PM
Quote from: peewan on 29 Jan 2020 11:12:32 AM
I'm using crosstab, and would like to sort my report.

Current:

          Male D   Female D   Female Sp      Female EE   Male EE   Male Sp   
0 to 18       7            5            0                1                      0                0            
19 to 26      1            1            1                1                      2                0            
27 to 29      1            1            1                1                      1                6

If I sort 'Gender' by A-Z; will be: Female EE\Female D\Female Sp\Male EE\Male D\Male Sp

I would like it: Male EE\Female EE\Male Sp\Female Sp\Male D\Female D

or at lease Male and female the same department go together.
Thank you

Hi,

Try adding a query calculation to your query:

CASE [Gender] 
WHEN 'Male EE' THEN 1
WHEN 'Female EE' THEN 2
WHEN 'Male SP' THEN 3
WHEN 'Female SP' THEN 4
WHEN 'Male D' THEN 5
WHEN 'Female D' THEN 6
ELSE 0 
END

You can then sort your column edge based on this. You may need to add it to the Properties property of the column edge.

Cheers!

MF.
Title: Re: Crosstab - Sort
Post by: peewan on 29 Jan 2020 03:36:26 PM
THANK YOU! THAT WORK GREAT!