Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 
aaronnayan
Creator III
Creator III

Rename 2 values in field to something else

Hi Guys,

Can anyone aid me in renaming 2 values within a field within the script?

Field = [Salesperson]

  • John
  • Mary
  • Sue
  • Frank
  • Barbara
  • Terry

I would like to change "Sue" to "Susan" and "John" to "Jonathon".

I have already tried if(Salesperson='Sue','Susan', AND if(Salesperson='John','Johnathon', Salesperson) as Salesperson

It doesnt work. The field Salesperson comes from a QVD with more than a 100 values.

I do alternatively have the SalespersonID field if something could be done from that?

 

 

 

 

5 Replies
Vegar
MVP
MVP

Try using ApplyMap() 

 

MapPerson:

MAPPING Load * inline [

A , B

Sue, Susan

John, Johnaton

];

 

Data:

Load 

Applymap ('MapPerson', Salesperson, Salesperson) as Salesperson,

Other fields

From Source;

aaronnayan
Creator III
Creator III
Author

Hi That doesnt work. I get no values loaded in the field....

Vegar
MVP
MVP

Oops, my bad. It is supposed  to be mapping load. I'll adjust my original answer. 

Brett_Bleess
Former Employee
Former Employee

Aaron, did Vegar's adjust post get things working as you wished?  If so, be sure to come back to the thread and use the Accept as Solution button on his main post to give him credit for the help and to let others know it did work.  If you are still working upon things, leave an update.

Regards,
Brett

To help users find verified answers, please do not forget to use the "Accept as Solution" button on any post(s) that helped you resolve your problem or question.
I now work a compressed schedule, Tuesday, Wednesday and Thursday, so those will be the days I will reply to any follow-up posts.
Marcos_rv
Creator II
Creator II

try this:
if(Salesperson='Sue', 'Susan' , if(Salesperson='John' , 'Johnathon', Salesperson) ) as Salesperson