I have a varchar column with alpha numeric records. I want to insert a decimal (period) after the first 3 characters. How do I accomplish this in the transformer?
Example
Current Diagnosis_Code
---------------------------
H13132D
78888D
43834
Converted As Diagnosis_Code
-----------------------------------
H13.132D
788.88D
438.34
Thanks!!
Insert decimal (period) after first 3 characters
Moderators: chulett, rschirm, roy
-
- Premium Member
- Posts: 32
- Joined: Mon Apr 12, 2010 3:42 pm
- Location: Minneapolis
- Contact:
Substring. Use the substring operators "[]" to take the first three and the rest of the field and concatenate the period between them. Off the top of my head and without any kind of syntax check:
That final size isn't important and won't error if it is 'too long' but you could always use the real size, even if it is not always known - that's what the length function is for.
Code: Select all
Current Diagnosis_Code[1,3] : '.' : Current Diagnosis_Code[4,999]
Last edited by chulett on Wed Aug 12, 2015 12:23 pm, edited 1 time in total.
-craig
"You can never have too many knives" -- Logan Nine Fingers
"You can never have too many knives" -- Logan Nine Fingers
-
- Premium Member
- Posts: 32
- Joined: Mon Apr 12, 2010 3:42 pm
- Location: Minneapolis
- Contact: