Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 
david_pearson
Contributor III
Contributor III

Reorder text in a field

Hi 

 

looking for some help at displaying a field in a different order. im sure it will be a combination of left and right functions but cant work it out.

i have a field called MM_CURR_SERV_OWNER which shows the owners name as SMITH, PAUL

i want an expression that shows the MM_CURR_SERV_OWNER as PAUL SMITH or even better Paul Smith.

can you help please

thanks

2 Solutions

Accepted Solutions
dplr-rn
Partner - Master III
Partner - Master III

In you load script add another column
Capitalize(
right(MM_CURR_SERV_OWNER,len(MM_CURR_SERV_OWNER)-Index( MM_CURR_SERV_OWNER, ',' )) & ' '& left(MM_CURR_SERV_OWNER,Index( MM_CURR_SERV_OWNER, ',' )-1)
) as MM_CURR_SERV_OWNER_FORMATTED

e.g.

Capitalize(
right('SMITH, PAUL',len('SMITH, PAUL')-Index( 'SMITH, PAUL', ',' )) & ' '& left('SMITH, PAUL',Index( 'SMITH, PAUL', ',' )-1)
)

 

returns Paul Smith

View solution in original post

pradosh_thakur
Master II
Master II

I am sorry. My bad. Missed to specify the delimitter

Capitalize(subfield(MM_CURR_SERV_OWNER,',',2)) & ' ' & Capitalize(subfield(MM_CURR_SERV_OWNER,',',1)) as MM_CURR_SERV_OWNER

Learning never stops.

View solution in original post

7 Replies
dplr-rn
Partner - Master III
Partner - Master III

In you load script add another column
Capitalize(
right(MM_CURR_SERV_OWNER,len(MM_CURR_SERV_OWNER)-Index( MM_CURR_SERV_OWNER, ',' )) & ' '& left(MM_CURR_SERV_OWNER,Index( MM_CURR_SERV_OWNER, ',' )-1)
) as MM_CURR_SERV_OWNER_FORMATTED

e.g.

Capitalize(
right('SMITH, PAUL',len('SMITH, PAUL')-Index( 'SMITH, PAUL', ',' )) & ' '& left('SMITH, PAUL',Index( 'SMITH, PAUL', ',' )-1)
)

 

returns Paul Smith

pradosh_thakur
Master II
Master II

try below

 

Capitalize(subfield(MM_CURR_SERV_OWNER,2)) & ' ' &  Capitalize(subfield(MM_CURR_SERV_OWNER,1)) as  MM_CURR_SERV_OWNER

Learning never stops.
david_pearson
Contributor III
Contributor III
Author

thank you for this. it's almost there. with your example code i now get Smith, Paul Smith, Paul

 

any further suggestions?

pradosh_thakur
Master II
Master II

@david_pearson  whose code did you try? It's not clear.

-Pradosh

Learning never stops.
david_pearson
Contributor III
Contributor III
Author

Capitalize(subfield(MM_CURR_SERV_OWNER,2)) & ' ' & Capitalize(subfield(MM_CURR_SERV_OWNER,1)) as MM_CURR_SERV_OWNER
pradosh_thakur
Master II
Master II

I am sorry. My bad. Missed to specify the delimitter

Capitalize(subfield(MM_CURR_SERV_OWNER,',',2)) & ' ' & Capitalize(subfield(MM_CURR_SERV_OWNER,',',1)) as MM_CURR_SERV_OWNER

Learning never stops.
david_pearson
Contributor III
Contributor III
Author

works great. thanks. i tried the other users solution and this also worked. thanks for your help