If you are unable to create a new account, please email support@bspsoftware.com

 

News:

MetaManager - Administrative Tools for IBM Cognos
Pricing starting at $2,100
Download Now    Learn More

Main Menu

sorting - positive and negative values

Started by cognosun, 20 Jun 2013 05:53:49 AM

Previous topic - Next topic

cognosun

Hi Gurus,

I've got these values under a column : 10, 6,-2,1,-5,9,0

I want report output in this way, in descending :

10
9
6
-5
-2
1
0

Can anyone suggest a way....

Many thanks in advance,

Joys




blom0344

2nd dataitem with a case that sets an 'index' for the right order in which you want it displayed:

CASE WHEN
[ITEM] = 10 THEN  '1'
WHEN [ITEM] = 9 THEN '2'
................
WHEN [ITEM] = -5 THEN '4'
................
WHEN [ITEM] = 0 THEN '7'
END

Are you up for an exam?

cognosun

hmmm....these are just sample rows...i need to handle 2k rows :-)

BigChris

Have you tried creating a calculated field abs(value) - i.e. taking the absolute value of your field - and sorting on that instead? I think that should do the trick..let me know.

blom0344

Quote from: BigChris on 20 Jun 2013 06:33:50 AM
Have you tried creating a calculated field abs(value) - i.e. taking the absolute value of your field - and sorting on that instead? I think that should do the trick..let me know.

Yes,of course Chris..  I didn't see the pattern here   ;D

cognosun

OK.

I'll try to sort descending on the absolute values ( already did this but didn't work...will re-try).

And this is first hurdle...second hurdle is to identify that negative value and making it red ( using conditional variables we can do this) but how to identify those negative values which are already turned positive :-)

Not exam exactly :-)


BigChris

Don't change the actual values to be positive - create a second column with the absolute value in. That way you retain the original negative / positive value which will allow you to use conditional formatting ... and will also mean that any totals or aggregates on the column are still correct. Then do your sorting on this second column, leaving your original column alone