Page 1 of 1

Trimmimg and concatination

Posted: Mon Jul 19, 2010 10:58 pm
by SBSA_DW
Hi

I'm using a triming function to trim a lot of unwanted characters in my data and after triming all these characters I also need to concatenate the column data with a number 20, but the concatenation does not happen. Is there a better way of achieving the result?

Trim(Trim(Trim(Trim(Trim(Trim(Trim(Trim(Trim(Trim(Trim(Trim
(Column_Name),'','L'),'#','L'),'+','L'),'.','L'),'//','L'),'/','L'),'\','L'),'`','L'),'','L'),'','T'),'*','L'):20

Posted: Tue Jul 20, 2010 1:37 am
by ray.wurlod
Try putting the right hand operand for the concatenation operator in quotes.

Code: Select all

Trim(Trim(Trim(Trim(Trim(Trim(Trim(Trim(Trim(Trim(Trim(Trim 
(Column_Name),'','L'),'#','L'),'+','L'),'.','L'),'//','L'),'/','L'),'\','L'),'`','L'),'','L'),'','T'),'*','L'):'20' 
Use a single Convert() function to get rid of the unwanted characters.

Code: Select all

Convert('#+./\`.*', '', InLink.ColumnName) : "20"

Posted: Tue Jul 20, 2010 1:48 am
by Sainath.Srinivasan
But Convert will remove ALL such values - even though they are in the middle.

The OP wants the leading ones.

Posted: Tue Jul 20, 2010 2:17 am
by SBSA_DW
Yes I only want to remove the leading characters.

I have tried putting in quotes for the 20 and it still does not help.

Your response in appreciated

Posted: Tue Jul 20, 2010 2:18 am
by ArndW
If your derivation ends with

Code: Select all

:"20"
then the 20 will be added to the end of the string.

Posted: Tue Jul 20, 2010 2:29 am
by Sainath.Srinivasan
Maybe your output consumes more space than allocated ?

Ensure that the target field length = sumOf(length of all fields used in compulation) + 2

Posted: Tue Jul 20, 2010 2:42 am
by SBSA_DW
Thanks for your responses

The length is 250 and the max data in the column is 25 characters.

With the assistance of a colleague, I have done the triming in functions in a stage variable, then the concatenation in the column derivation and this has resolved my problem :D