cancel
Showing results for 
Search instead for 
Did you mean: 

String Function

Former Member
0 Kudos

Hello Guru's

I want to do calculation ( For example Work Center : 1234/abcd, 12/fgh, 56789/gh), I want to see only characters after / this. I should see only abcd, fgh, fgh).

Any help would be greatly appereciated.

Thanks

Nisniki

Accepted Solutions (1)

Accepted Solutions (1)

Former Member
0 Kudos

here is the Oracle SQL code

SELECT SUBSTR('1234/fgh', INSTR('1234/fgh','/')+1) FROM dual;

basically it picks up everything after the '/' in the string. if you take out the '+1' it will result in '/fgh'. if you use '-1' then it results in '4/fgh'

hope that is what you're looking for.

Answers (1)

Answers (1)

Former Member
0 Kudos

Hi,

your question is not clear, appreciate if you could explain your requirment.

Former Member
0 Kudos

I want to search "/" in work center and want to remove characters before /.

For Example:Work Center: 1234/New York, 45/Chicago. I want to see only New York and Chicago.

Thanks

Nisniki

fritzfeltus
Product and Topic Expert
Product and Topic Expert
0 Kudos

You can use the following webi formula. string is the dimension which contains your work center string.

=Right([string];Length([string])-Pos([string];"/"))

Former Member
0 Kudos

Thank you guys for the help.

Former Member
0 Kudos

Fritz,

I tried you formula and I am getting the whole string. Like 1234/ABCD.

Here is the formula I used.

=Right([Wc Name];Length([Wc Name])-Pos([Wc Name];"/"))

Thank you in advance.

Nisniki

fritzfeltus
Product and Topic Expert
Product and Topic Expert
0 Kudos

If I do this:

=Right("1234/ABC";Length("1234/ABC")-Pos("1234/ABC";"/"))

I get this:

ABC

Can you try? Also doublecheck your string value and the delimiter (forward slash, backslash)...

Former Member
0 Kudos

Fritz,

Thank you very much. It worked. If I want to see character before "/" this then Do I need to use Left instead of Right function.

Thanks,

Nisniki

fritzfeltus
Product and Topic Expert
Product and Topic Expert
0 Kudos

If you need everything before the slash, you can use this:

=Left("1234/ABC";Pos("1234/ABC";"/")-1)

Former Member
0 Kudos

Thanks for your quick reply. Do I need to use Length function for that.

Thanks

Nisniki

Former Member
0 Kudos

Thanks man. It workded.