on 01-27-2012 4:36 PM
Hi Folks,
Can anyone help me out on how to parse the characters in data services. Here is the example:
Rule: Parse first three characters MU_1000008 to 1000008
What is the function I can use?
Any help is appreciated.
Thank you
Hi,
1. If you just want to take all characters starting from the 4th character till the end, you can use:
substr(input_col,4,length(input_col)-3)
2. If you always want to read the characters following the first underscore, use:
word_ext(input_col,-1,'_')
3. If your input always start with 'MU_', then use:
replace_Substr(input_Col,'MU_','')
or
ltrim(input_col,'MU_')
Regards,
Shine
Edited by: Shine SS on Jan 28, 2012 10:52 AM
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi,
Look in the Data Services Reference Guide for functions 'lpad', 'lpad_ext' and 'ltrim' syntax.
One of these should help you trim your data. You can use the function inside a mapping, in a query transform.
Hope it helps,
Pedro
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
84 | |
23 | |
11 | |
9 | |
8 | |
5 | |
5 | |
5 | |
5 | |
4 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.