-
Remove leading characters IF
Steve Kang Feb 28, 2012 8:58 PM (in response to Jonathan Love)I think you'd better to use the below.
If(WildMatch(Ltrim(Individual_Item_Number), '77*') > 0
, ltrim(replace(Individual_Item_Number,'77',''))
, Ltrim(Individual_Item_Number)
) as Dupe
Good luck!
Steve Kang.
-
Remove leading characters IF
Jonathan Love Feb 28, 2012 9:08 PM (in response to Steve Kang )Not quite, still strips all instances of 77. 7717708 returns 108 as opposed to 17708.
-
Re: Remove leading characters IF
Celambarasan Adhimulam Feb 28, 2012 11:59 PM (in response to Jonathan Love)Hi,
Try with this
if(Left(Trim(Individual_Item_Number),2)='77',Right(Trim(Individual_Item_Number),len(Trim(Individual_Item_Number))-2,Trim(Individual_Item_Number)) as Dupe
Hope it helps
Celambarasan
-
Remove leading characters IF
Jonathan Love Feb 29, 2012 9:02 AM (in response to Celambarasan Adhimulam )Thank you all very much. JL
-
-
Remove leading characters IF
jagan mohan rao appala Feb 29, 2012 3:08 AM (in response to Jonathan Love)Hi,
This works as you expect, in this we are checking the two numbers from left if it is 77 then we truncate the left 77 and fetch the remaining numbers by using Right().
=If(Left(Trim(Individual_Item_Number), 2) = '77',
Right(Trim(Individual_Item_Number), len(Trim(Individual_Item_Number))-2),
Trim(Individual_Item_Number)) as Dupe
Hope this helps you.
Regards,
Jagan.
-
-
-
Re: Remove leading characters IF
Chee Tiong Chua Feb 29, 2012 2:38 AM (in response to Jonathan Love)I hope it achieves what u want.
If(WildMatch(Ltrim(Individual_Item_Number), '77*') > 0
,mid(Individual_Item_Number,3),Individual_Item_Number
) as Dupe,
Goodluck