COGNOiSe.com - The IBM Cognos Community

IBM Cognos 8 Platform => COGNOS 8 => Report Studio => Topic started by: Jkelly228 on 17 Jun 2011 05:53:51 PM

Title: Trim Value
Post by: Jkelly228 on 17 Jun 2011 05:53:51 PM
Hello All,

I have a value where I need to trim the first 19 characters off in order make it more usable. I am graphing some data and it all starts off "Hold:1 = Line:Sales Real Value" (substitute "Real Value" for the true reason for the hold). I need to get rid of the portion in red in order to get a true value for the chart.

Below is the what I have so far for trim, but I just get an error back. I am sure it is simple, but I am pretty new to this. Thank you in advance.

trim(leading,[OracleCustomObjects].[HYP_DW_BOOK_OPEN_SHIP].[HOLD_REASONS],15)

Kelly
Title: Re: Trim Value
Post by: cognostechie on 17 Jun 2011 07:48:58 PM
Why not just use the substring function? and in your case, you have to trim 20 characters, not 19 otherwise you will be displaying a blank before the 'Real Value'.

substring([OracleCustomObjects].[HYP_DW_BOOK_OPEN_SHIP].[HOLD_REASONS],20,50)

Replace 50 with the no. of characters you want to be displayed and replace [OracleCustomObjects].[HYP_DW_BOOK_OPEN_SHIP].[HOLD_REASONS] with whatever name you have in Cognos.
Title: Re: Trim Value
Post by: Jkelly228 on 21 Jun 2011 11:55:39 AM
Thank you. this worked perfectly. I appreciate you taking the time to explain it to me as well. I have a lot of uses for it.

Kelly