Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Hello,
In my column (Unique identifier) I have data in this format 111122223333. I want to have data as 1111_2222_3333 format. This column has more that 150k records. How can i replace data from this format 111122223333 to 1111_2222_3333.
Can I do this in my load script when i load the unique identifier column? Thank you in advance!
Regards,
Kailash
Hi,
Maybe something like this:
Left(Field,4)&'_'&Mid(Field,5,4)&'_'&Right(Field,4) as FormattedField?
I hope this is helpful,
Cheers,
L
I need it in this format because i have to join this column with other table where the unique identifier is in 1111_2222_3333 format
Hi,
Maybe something like this:
Left(Field,4)&'_'&Mid(Field,5,4)&'_'&Right(Field,4) as FormattedField?
I hope this is helpful,
Cheers,
L
provide some sample data to generalize expression
then why don't you replace the '_' with '' in the key of your other tables? that is relatively simpler!
so all your keys are in 111122223333 format without the '_'
also if you already have well formatted keys in other tables then you can also create a mapping table by replacing the '_' with null
Hi Vineet,
Thanks for the suggestion. Can you give me an example. I can change the format of either of the table. Can you give me an example for it ?
Regards,
Kailash Kotak
purgechar(key, '_')
-Rob
I would be careful about removing the '_' as it is a character delimiter that can make all the difference as a unique identifier. If your field is always formatted the same way, Eg 12 characters long, then removing the '_' can work. However if the format is not structured, then removing the '_' may also remove the uniqueness. For example 1_23 and 12_3 would both be represented as 123 if you removed the '_', and therefore you can no longer use that field to distinguish between 1_23 and 12_3.
Thank you everyone!