on 2024 Mar 19 8:04 AM
Hi All,
Can you please help me with a function in Webi which gives us the position of some character's occurrence multiple times in the same string.
Pos() function gives the position of a character, however if the same character is present multiple times, how to get its position.
For example:
String(1): AP 0,G3 16.36,HK 0,B5 5.62,WY 16.53
String(1) is a column which has this concatenated text and numbers as above.
Now, I need to know the position of all commas and spaces present in this string more than once.
Can u please help me with the formula to get the following splitted from String(1):
String(1): AP 0,G3 16.36,HK 0,B5 5.62,WY 16.53
AP---- =Substr([String(1)];1;(Pos([String(1)];" ")-1))
0 --- need formula here
G3 -- =Substr([BILLED_TAX_STRING];(Pos([BILLED_TAX_STRING];",")+1);(Pos([BILLED_TAX_STRING];" ")-1))
16.36 -- need formula here
HK -- need formula here
0 -- need formula here
B5 -- need formula here
5.62 -- need formula here
WY -- need formula here
16.53 -- need formula here
Please don't Hardcode the values, as we have different values in the report for String(1)
More examples for String(1) values present in the same report:
| String(1) |
| AP 0,G3 16.36,HK 0,I5 5.62,WY 16.53 |
| AU 30.91,WG 5.22,WY 8.9 |
| L7 1.76,OP 0,SG 3.51,WG 1.6,WY 14.63 |
| QR 7.97,QR 2.32,WG 3.35,WG 0 |
| E7 .78,G8 .34,TS 15.55,WG 0,WY 0 |
| F1 2.47,IA 8.04,KK 11.57,WG 0,WY 0 |
If anyone can help, would be really helpful.
Thank you in Advance🙏
Regards,
Shilpi
Request clarification before answering.
I found the solution.
First I followed
https://community.sap.com/t5/technology-q-a/need-to-split-string/qaq-p/9344510
After this,I counted the commas in the string using Replace and Length function.
and then applied If condition based on number of commas.
Thankyou so much for initial help after which I was able to conclude further 🙂
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
| User | Count |
|---|---|
| 18 | |
| 7 | |
| 6 | |
| 6 | |
| 4 | |
| 4 | |
| 4 | |
| 2 | |
| 2 | |
| 2 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.