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

Announcements
Join us in Toronto Sept 9th for Qlik's AI Reality Tour! Register Now
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

Extract substring

Hi all,

from a long string i want to extract a fixed number of characters beginning at a certain string.

Example:

Original String:

thisisjustasimpleexampleofmyproblem

lets say i want to extract the first 2 characters after the string simple, which would give me 'ex'.

I want to do this in many strings. The only thing these strings have in common is the 'simple'.

How would i do this ?

Thanks a lot!

3 Replies
Not applicable
Author

mid(orginalstring,index(orginalstring,'simple'),2)

Not applicable
Author

once again:

mid(orginalstring,index(orginalstring,'simple')+6,2)

Anonymous
Not applicable
Author

This will work:

=mid('thisisjustasimpleexampleofmyproblem',
index('thisisjustasimpleexampleofmyproblem','simple')+len('simple'),
2)

Just repalce the strings here with your fields or variables.

Regards,

Michael