COGNOiSe.com - The IBM Cognos Community

IBM Cognos 8 Platform => COGNOS 8 => Report Studio => Topic started by: barrysaab on 18 Jul 2011 07:53:31 AM

Title: Sorting issue
Post by: barrysaab on 18 Jul 2011 07:53:31 AM
hello all
I have list report and have a column Category which has "New Store" and "Old Store". This report is mainly developed through

Sql Query. The Problem is when i drag Category column it comes as New Store and Old Store where as the requirement is that it

Old stores should come first. What i did is I dragged a data item and wrote expression if([sql][Category]= 'Same Store') then (1) else (2)

and then cut the column from report page and sorted category as descending, it did the trick and met the requirement. My question is when i am sorting as ascending it is same old thing where as ascending should have worked. I am confused, what is going on here. Could gurus please explain. Thanks.
Title: Re: Sorting issue
Post by: Arsenal on 19 Jul 2011 11:28:15 AM
your expression is if([sql][Category]= 'Same Store') then (1) else (2)

so "same store" gets value of 1 and "old store" gets value of 2. Sorting this descending will ensure that the value 2 ( old store) will always be on the top. Sorting this ascending causes the value 1(new store) to be on top.