Qlik Community

QlikView Scripting

Discussion Board for collaboration on QlikView Scripting.

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

Tags (2)
1 Solution

Accepted Solutions

Re: Text between from the right side

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


talk is cheap, supply exceeds demand
3 Replies

Re: Text between from the right side

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


talk is cheap, supply exceeds demand

Re: Text between from the right side

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

Re: Text between from the right side

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

Community Browser