cancel
Showing results for 
Search instead for 
Did you mean: 

Parse a text string

Former Member
0 Kudos

Hi Experts

I have a field in my dB that is storing a hierarchy as single string:
/warehouse/section/aisle/rack/bin

I want to parse this field into 5 variables. 
I know I can find the position of the “/” and write formulas using SUBSTR or LEFT/RIGHT.  But this creates very complex formulas the deeper I go into the hierarchy.

Does anyone know of an easier way to do this?
For example, is there a way to get the position of the third “/” and fourth “/” etc.?
   . . . then I could write a formula =Substr([object];[ third “/”];[fourth “/”])

Accepted Solutions (1)

Accepted Solutions (1)

Former Member
0 Kudos

Unfortunately there is no functions available in webi to get the position of 2nd or any other occurrence...

I have been looking for the same thing some times back and the efforts are futile.. so the the only option you have is what you described earlier even though its going to be very complex ..

Former Member
0 Kudos

Thanks for response, Durga.

This confirms what I had feared.

Looks like another feature that I can do in Crystal Reports but not in WebI.

Promote the idea if you get a chance:

https://ideas.sap.com/ct/ct_a_view_idea.bix?c=1DA84A30-1E5A-43FA-95C5-857A8B99D197&idea_id=36E0E426-...

Answers (2)

Answers (2)

Former Member
0 Kudos

Hi,

maybe you think about developing an own function

http://help.sap.com/businessobject/product_guides/boexir31SP2/en/xi31_sp2_webi_calc_ext_en.pdf

This option is also available in BO 4.x

Best regards,

Andreas

Former Member
0 Kudos

Hi Andreas,

Nice idea..this is a good possibility to get the functionality in.. but I am afraid the time to develop the function might be longer than create some how complex formula using POS and substr function ..

However I strongly think SAP should consider including these small thing which are very helpful in future releases..

former_member188911
Active Contributor
0 Kudos

if you have ideas for enhancements you can submit them at https://ideas.sap.com

thanks

Simone

Former Member
0 Kudos

thanks for responding, Simone

I have submitted the idea

https://ideas.sap.com/ct/ct_a_view_idea.bix?c=1DA84A30-1E5A-43FA-95C5-857A8B99D197&idea_id=36E0E426-...


hope it gots lots of votes

Former Member
0 Kudos

Thanks for creating the idea place entry..Voted it up

former_member188911
Active Contributor
0 Kudos

you got my vote as well, however the suggestion of the extension points could be something you would wish to explore.

I am not 100% sure if you can do it however if you have some spare time you may wish to try...

thanks!

Simone

sateesh_kumar1
Active Contributor
0 Kudos

Hi Mike ,

it's based on assumption only , let's say we are getting "_" three /four times in a string

your string length is 20

=Pos(Substr([L01 Material Key];1;3);"_")+";"

add you formula by n times . n=length of string/your substring length

Pos(Substr([L01 Material Key];4;6);"_")+";"+Pos(Substr([L01 Material Key];7;9);"_")+.....

Former Member
0 Kudos

A fine idea if each record is the same fixed length. . .

but what do you do when the field length is variable?

example:

/CA452/A/27-C/2/14

/NY17/14/12/B3/2

/FL8//B-7/4/1