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 Varchar field in Crosstab Report

Started by gatorfe, 24 Jun 2014 03:39:38 PM

Previous topic - Next topic

gatorfe

Hello, we have a crosstab report that has a varchar field.  This sql varchar field contains letters and numbers.  There are 3 values we want to sort on this particular  report.  They are 2205, 316, 316B.  When the field is sorted now on the report it shows 2205, 316, 316B.  The users wants it to be 316, 316B, and 2205.  Since the field that contains the data is a varchar how can we do this?  Thanks in advance for your suggestions!

rprameshwor

#1
 316, 316B, and 2205.

Make a new data-item with expression something like :

case
when [field]='316' then '1'
when [field]='316B' then '2'
when [field]='2205' then '3'
end

Then, sort the field by this new data-item.

Check this : http://www-01.ibm.com/support/docview.wss?uid=swg21338917

raj_aries81

#2
Create a new dataitem and then cast it to integer and use it for sorting. For example create a new dataitem something like cast([existing varchar dataitem],int) and then include it in (advanced) sorting

Regards
Raj