COGNOiSe.com - The IBM Cognos Community

IBM Cognos 8 Platform => COGNOS 8 => Report Studio => Topic started by: ipmurali on 07 Nov 2007 08:29:54 AM

Title: Eliminate trailing blank spaces
Post by: ipmurali on 07 Nov 2007 08:29:54 AM
Hi Guys,
I am using a DB2 table connected thru Composite ODBC to produce a report. I want to concatenate FNAME with LNAME to get full name, but FNAME having some trailing spaces, which i need to remove. How can I do this?

I tried trim and rtrim function in Framework manager/Report Studio but this gives error.

appreciate your help !!!

thanks and regards
Murali.
Title: Re: Eliminate trailing blank spaces
Post by: Feanor on 07 Nov 2007 09:00:34 AM
TRIM or RTRIM should do the trick. What error do you get?

Maybe you should cast both query subjects to a VCHAR first.
Title: Re: Eliminate trailing blank spaces
Post by: nuknsltnt on 07 Nov 2007 09:01:01 AM
Murali,

You can try using pass-through sql in FM. Create a calculation in FM which concatenates FNAME + LNAME and make the SQL pass-through. This should work.

You can then use the calculation in your package for reporting purpose.

Let me know if this works.

Cheers,
nk
Title: Re: Eliminate trailing blank spaces
Post by: ipmurali on 07 Nov 2007 11:24:46 PM
thanks guys

it worked like this

I chanaged the property of Data Source->Query Processing to Limited Local in FM, then used trim.

regards,
Murali.
Title: Re: Eliminate trailing blank spaces
Post by: Feanor on 08 Nov 2007 05:05:11 AM
Thanks for sharing.

Limited local processing is sometimes necessary if you want to perform certain actions that are not supported by database only processing. Apparantly this is one of those actions.

Glad you could solve it.  :)