Do not input private or sensitive data. View Qlik Privacy & Cookie Policy.
Skip to main content

Announcements
Join us to spark ideas for how to put the latest capabilities into action. Register here!
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

How to extract only a part of information from a string?

I have a column with a String abc/def/123/useful_value.

How do I extract the substring useful_value?

The number of '/' can be different in different strings but there is not any other special character.

1 Solution

Accepted Solutions
alexandros17
Partner - Champion III
Partner - Champion III

Try with

Subfield(mystring, '/', -1)

let me know

View solution in original post

5 Replies
alexandros17
Partner - Champion III
Partner - Champion III

Try with

Subfield(mystring, '/', -1)

let me know

Anonymous
Not applicable
Author

Hi

right('abc/def/123/useful_value',12) return useful_value

mid('abc/def/123/useful_value',13) return useful_value

SubField('abc/def/123/useful_value','/',4)  return useful_value

Regards.

julian_rodriguez
Partner - Specialist
Partner - Specialist

You need a way to identify the position of the "useful_value".

What is the rule?.. it's difficult create a script for any possible position of the value into the text.

For example, the useful value is part of a reduced list of "useful values"? 

All the above suggestions are limited to a rule, but I unterstood that you can't define the text position, but you need to do it.

Anonymous
Not applicable
Author

Hi Anshul,

Try

=SubField(FieldName,'/',4) 

Not applicable
Author

Hi,

Subfield(mystring, '/', -1) gives the perfect answer I need.

I needed the last value after '/' and there can be different numbers of '/' so I cannot use count from left side.

Thank you so much!