user2830047
user2830047

Reputation: 53

Derived Column Error

I have a column in table which needs to be replaced with certain part of the word to an another one I used Derived column but There is no change at all

Ex:

Input:

S.no        Name             Department
1           Mike             San Diego Soceity Office
2           Stat             New York Soceity Office

Output should be like

S.no        Name             Department
1           Mike             San Diego S.O
2           Stat             New York S.O

In derived column i used the following code

Replace(Department,"Soceity Office", "S.O")

Confidentiality

Upvotes: 2

Views: 95

Answers (2)

billinkc
billinkc

Reputation: 61211

The other thing to be aware beyond misspellings as @sqlgrl pointed out (and welcome to the [ssis] tag) is that string operations are going to be case sensitive.

REPLACE(Department,"Soceity Office","S.O.")

You can see below, I took your sample data and ran it through two different replace statements. One accounts for the proper spelling of Society, the other uses your spelling (which is probably why you're standardizing to S.O.)

enter image description here

Originally, I had used "Soceity office" and was observing no change and again, that is due to a casing issue.

Upvotes: 0

sqlgrl
sqlgrl

Reputation: 66

Maybe try checking your spelling? Is it possible that you are trying to replace Society Office not Soceity Office in the Department field? Otherwise the code looks good to me.

Replace(Department,"Society Office", "S.O") 

Upvotes: 2

Related Questions