Categories
- All Categories
- 15 Oracle Analytics Sharing Center
- 16 Oracle Analytics Lounge
- 216 Oracle Analytics News
- 43 Oracle Analytics Videos
- 15.7K Oracle Analytics Forums
- 6.1K Oracle Analytics Idea Labs
- Oracle Analytics User Groups
- 79 Oracle Analytics Trainings
- 15 Oracle Analytics Data Visualizations Challenge
- Find Partners
- For Partners
SUBSTRING or LOCATE in OBIEE

I have a NAME column with values like XXX, YYY (LastName, FirstName). Can you please help me with report formula to show the values like YYY XXX (FirstName LastName)?
Comments
-
What did you try so far? Because if you tried, you definitely had it right after few attempts...
LOCATE tells you where the ',' is in your string, then you need to take what is on the left and on the right.
For the XXX part, if you use LEFT() it's easier, because you can use the result of LOCATE() -1 to get the number of characters to take.
For the YYY part you need to know how many characters you need to take. Here using RIGHT() will be easier, because you can use LENGTH() - LOCATE() -1 to get the number of characters.
If you did use SUBSTRING you could get the same result, but while for the XXX part it would be the same complexity than LEFT(), for the YYY part you would have an addition call to LOCATE() because you need to have the start position and the number of characters. By using RIGHT() you gain 1 call to LOCATE(), and that's always good because less functions = less work for the database.
By the way: when you have a question you should use "Ask a question" and not "New Discussion".
1 -
Thank you so much for the details
0