Skip to main content
Announcements
Qlik Connect 2024! Seize endless possibilities! LEARN MORE
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

Text between from the right side

Hello all,

as you can read in the title, how can I to the text between function from the right side?

Example:

c:\\Folder\Sub\Sub2\File1.txt

c:\\Folder\Sub\Sub3\Sub7\File2.txt

c:\\Folder\Sub\Sub2\File3.txt

I need to get a column with values like this:

Table:

File1,

File2,

File3.

Is there a way to do this?

Thanks in advance

1 Solution

Accepted Solutions
Gysbert_Wassenaar

subfield(subfield('c:\\Folder\Sub\Sub2\File1.txt', '\', -1),'.',1)


talk is cheap, supply exceeds demand

View solution in original post

3 Replies
Gysbert_Wassenaar

subfield(subfield('c:\\Folder\Sub\Sub2\File1.txt', '\', -1),'.',1)


talk is cheap, supply exceeds demand
sunny_talwar

Try this may be:

Replace(SubField(FieldName, '\', -1), '.txt', '')


Update:

Script:

Table:

LOAD *,

  Replace(SubField(FieldName, '\', -1), '.txt', '') as NewFieldName;

LOAD * Inline [

FieldName

c:\\Folder\Sub\Sub2\File1.txt

c:\\Folder\Sub\Sub3\Sub7\File2.txt

c:\\Folder\Sub\Sub2\File3.txt

];

Output:

Capture.PNG

Not applicable
Author

Hi

  The script is like this.

T1:

LOAD * Inline [

data

c:\\Folder\Sub\Sub2\File1.txt

c:\\Folder\Sub\Sub3\Sub7\File2.txt

c:\\Folder\Sub\Sub2\File3.txt

];

T2:

LOAD *,

SubField(SubField(data,'\',-1),'.',1) AS FILE

Resident T1;

DROP Table T1;

see the attached qvw