cancel
Showing results for 
Search instead for 
Did you mean: 

use of BO function

0 Kudos

Hi

Could you please help me to solve the below question.

Eg. In my WebI report i have a column with customer name like eg. Maria George Asker.

But I have to display only middle name of the person like George.

Which function shall I use to solve above requirement.

Thanks

Hemlata

Accepted Solutions (1)

Accepted Solutions (1)

Former Member
0 Kudos

Hi Hemlata,

You can use substr to extract any string from other string , but you have to define the start point of extraction and the number of characters to extract.

Ex: Substr("Maria George Asker";7;6) would give you George.

I undertsand you requirement is more of dynamic, so your extraction point and number of characters would vary, In such cases you can use function POS to define position of first space character and define extract point as (position of space+1) and your number of characters would again go through one more substring as below.

Var1=substr(customer name;pos(customer name;" ")+1,length(customer name)-pos(customer name;" ")+1)) to extract the whole string "George Asker"

Var2=substr(Var1;1,pos(customer name;" ")-1) to extract "George" from "George Asker"

let me know if this helped

Thanks

Mallik

former_member188911
Active Contributor
0 Kudos

Mallik is right, you can do some variations though.

1. the object and variable names must be in square brackets

2. for Var2 you can simply use Left([Var1];Pos([Var1];" "))

3. for Var1 instead of calculating the length you can use as length a huge number i.e. 500

Var1=substr([customer name];pos([customer name];" ")+1,500)

May seem marginal however in complex reports every little helps and can improve performance during the calculation phase.

Last but not least, the caveat that this is NOT an accurate method because there are people who may have a complex middle name, others may have a composite last name.

The rule would be to create a dedicated field in the database

Thanks

Simone

0 Kudos

Hi Mallik,

Thanks!
Really great! It also worked for me.

I used below variables.
store name is taken for example purpose.

V2=Substr([Store name];(Pos([Store name];" ")+1);Length([Store name])-(Pos([Store name];" ")))

v3=Substr([v2];1;Pos([v2];" ")-1)

Thanks!

BR\Hemlata

Answers (2)

Answers (2)

Former Member
0 Kudos

Hi Hemlata,

Is the issue resolved. Are you able to achieve this?

Thanks

Mallik

0 Kudos

Hi,

Yes It is resolved.

Thanks

Hemlata

Former Member
0 Kudos

Hi,

If you have 3 words in name at all the time, then follow below approach:

1.

2.

3.

4.

5.

Hope it helps

Thanks,

Parthiban