on 08-21-2014 4:49 PM
Hello All,
I want to create an object in universe which should return a substring.
Example:
object name: class\test
value1: cust_no_123_name_tom
value2: cust_no_1234_name_tom
Now I want to extract tom from the above strings. I cannot use simple substr fuction as the cust_no are different.
it may we 123 or 12345 or 123456
So I need to create a condition that if chars in string = 'name' then display next 3characters.
i tried with below formula but it is not working as expected.
CASE WHEN @Select(class\object) LIKE '%name_%'
THEN substr(@Select(class\object),1,3)
ELSE '0'
END
the output of the above formula is:
value1: cust_no_123_name_tom
value2: cust_no_1234_name_tom
Please suggest.
Thanks & Regards,
Kaustubh Ghate
What is your underlying database? This will determine what functions you can use to get what you want.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi Mark.
Thank you for your help. The formula worked with aur actual objects.
Can u please help me with one more query. I need everything to be displayed before '_name_tom'. i am trying but not able to implement it correctly.
example:
value: cust_no_1234_name_tom
result: cust_no_1234
Thanks & Regards,
Kaustubh
Hi,
Use the Right function to extract tom from the string.
Create one object like this.
right(@Select(class\object),3)
This object will display the right most three character always.
Amit
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
89 | |
10 | |
9 | |
9 | |
9 | |
6 | |
6 | |
5 | |
5 | |
4 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.