cancel
Showing results for 
Search instead for 
Did you mean: 
Read only

formula for splitting fullname as firstname and lastname in BO 4.3

ValliSadasivam
Newcomer
0 Kudos
387

i was trying to split  a fullname with the below formula
as firstname , lastname (wherein fullname including with the middle name in it.)

Below Formula worked fine: 

First Name=Left(Substr([Name];Length(Substr([Name];1;Pos([Name];" "))+2);Length([Name]));Pos(Substr([Name];Length(Substr([Name];1;Pos([Name];" "))+2);Length([Name]));" "))

Last Name=Right(Substr([Name];Length(Substr([Name];1;Pos([Name];" "))+2);Length([Name]));Pos(Substr([Name];Length(Substr([Name];1;Pos([Name];" "))+2);Length([Name]));" ")+2)

QUESTION : Is there anyother simpler way we can achieve this and also Mid funtion is not available in Webi?

LAST_NAME: Mid(PATRN_NAME,1,InStr(PATRN_NAME,',')-1)

Accepted Solutions (0)

Answers (1)

Answers (1)

ayman_salem
Active Contributor

Define the following variables:

v_FirstName:    =Left([fullname];Pos([fullname]; " "))

v_LastName:  =Right([fullname];Length([fullname])-Rpos([fullname]; " "))

 

B_20241224_1.JPG

...

Hope it helps

 

drs_macgyver
Explorer
0 Kudos
This is probably as good as it can get but you will have outliers for compound names that have spaces. Mary Jane could be considered a first name and Van Morrison a last. Add to this that some may have multiple middle names.