on 07-13-2015 7:49 PM
If my name is in format Pathak,Raja, i want to find my last name as Pathak and first name as Raja in universe designer only.
I know how it can be done in report level but since pos() and left/right function is not available in universe designer am looking for alternate solution
Use this:
SUBSTR(table.column_name,1,instr(table.column_name,',',1,1)-1)
It creates a substring from the first character to the character before the first comma in the field
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
For first name, use this:
SUBSTR(table.column_name,instr(table.column_name,',',1,1)+1,len(table.column_name)-instr(table.column_name,',',1,1))
This will create a substring from the first character after the comma through to the end of the string, so if you have Woods,Tiger this will just return Tiger
If you have Woods, Tiger with a space after the comma, then you will need this:
SUBSTR(table.column_name,instr(table.column_name,',',1,1)+2,len(table.column_name)-1-instr(table.column_name,',',1,1))
HOWEVER!!!!
All this falls down with names where last name has a comma in it. Thankfully, this tends not to happen with the apostrophe a far more likely character in both eastern and western names.
Create two dimensions in the business layer:
LastName=
mid(name_field,1,instr(name_field,',')-1)
FirstName=
mid(name_field,instr(name_field,',')+1)
-Ankush
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
what is your backend database?
Thanks,
Swapnil
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
87 | |
10 | |
10 | |
9 | |
7 | |
7 | |
6 | |
5 | |
4 | |
4 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.