Hello Everyone
I have a cloumn which gives me URl paths for different file locations.
For Example: http://cdrive/good/eater.pdf
http://fdrive/bater.pdf
So i need to extract only Bold part of url.Means i need to get only part after last '/'.
if any one have any ideas please share with me.
Thanks
Vin
LastIndexOf('/') ?
Thanks for your response
url path is my query item.So I have to create a calculation which gives me
that file name.
I am unable to use lastindexof.
Please give me your suggestion.
Thanks
cogboy
if on Oracle try:
substr([url path],instr([url path],'/',-1)+1)
Keep in mind thay you can add ANY function to Cognos Suite. Even a non-database one if I understand the Framework correctly. It is just a matter of how much effort would you like to invest.
I am on Sql not on oracle but any ways i appreciate yur response
I imagine that your database has similar functions for extracting a portion of a string or locating a string within a string, perhaps you could extrapolate from the Oracle example.
This should work on SQL Server.
Sample
declare @str varchar(50)
set @str='http://cdrive/good/eater.pdf'
select reverse(substring(reverse(@str),1,charindex('/',reverse(@str))-1))
in your FM query replace the bold part with your column name
select reverse(substring(reverse(@str),1,charindex('/',reverse(@str))-1))