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.
Hi Shilpi,
As values are in uneven length and it would be little tricky to achieve at webi level. Also we will have to create many variables to handle this.
In the past, we have achieved at Universe level with the derived table.
What is your underlying database pointed to ?
Thanks,
Jagadeesh C
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi Jagadeesh,
My underlying Database is Oracle and the report is created on "Free Hand Sql" Webi version 4.2.
As u have handled such situation in Universe, Can u please explain in detail, so I may try to check if It is possible to create a separate report for this requirement
based on universe.
Also, Do u know the way to get the count of a specific character in a string in Webi.
Regards
| 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.