Skip to main content
Announcements
See why Qlik was named a Leader in the 2024 Gartner® Magic Quadrant™ for Data Integration Tools for the ninth year in a row: Get the report
cancel
Showing results for 
Search instead for 
Did you mean: 
EliGohar
Partner - Creator III
Partner - Creator III

Extract text after last slash (/) sign

I have a field with the following texts for example:

 

 - Test Cases/On Premise Web-Admin/Add Camera

- Test Cases/On Premise Web-Admin/Admin_Login

- Test Cases/On Premise Web-Admin/Check Services

and so on.

I'd like to extract the text but from the position of the last '/' until the end of the text, so the new values will be:

 - Add Camera

- Admin_Login

- Check Services

Can you assist?

Thanks,

Eli.

1 Solution

Accepted Solutions
rbartley
Specialist II
Specialist II

Hi,

Index(<fieldname>,'/',-1) , will give you the position of the last forward slash ('/') character in the field (replace <fieldname>  with the name of your field.

So, just use something like:-

=Mid(fieldname,Index(fieldname,'/',-1)+1 ,len(fieldname)) to just get the text after the slash

or, if you want to include the ' - ' at the beginning:-

=Left(fieldname,2) & Mid(fieldname,Index(fieldname,'/',-1)+1 ,len(fieldname))

 

 

View solution in original post

4 Replies
rbartley
Specialist II
Specialist II

Hi,

Index(<fieldname>,'/',-1) , will give you the position of the last forward slash ('/') character in the field (replace <fieldname>  with the name of your field.

So, just use something like:-

=Mid(fieldname,Index(fieldname,'/',-1)+1 ,len(fieldname)) to just get the text after the slash

or, if you want to include the ' - ' at the beginning:-

=Left(fieldname,2) & Mid(fieldname,Index(fieldname,'/',-1)+1 ,len(fieldname))

 

 

Ponkaviyarasu
Partner - Contributor III
Partner - Contributor III

Hi!

Us this expression:

Subfield(Column,'/',3)

 

Thanks

Sujy15
Contributor II
Contributor II

Hi @EliGohar ,

You can use subfield(Fieldname,'/',-1)  [ -1 retrieves the data from the position of the last]

Hope this answer helps you!

Thanks!

EliGohar
Partner - Creator III
Partner - Creator III
Author

Thanks!