Skip to main content
Announcements
Have questions about Qlik Connect? Join us live on April 10th, at 11 AM ET: SIGN UP NOW
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

compare variable to file name without extension and folders

Hi I would like to now the syntax to compare a variable with a file name , to the actual file name disregarding the path and the extension of the file.

how it is done?

Thanks,

Boris

1 Solution

Accepted Solutions
swuehl
MVP
MVP

If you have a FILENAME like

c:\Path\Filename.ext

you can extract the Filename like

=subfield(subfield(FILENAME, '\', -1),'.',1)

Or have a look at the system functions, especially FileBaseName()

View solution in original post

4 Replies
swuehl
MVP
MVP

If you have a FILENAME like

c:\Path\Filename.ext

you can extract the Filename like

=subfield(subfield(FILENAME, '\', -1),'.',1)

Or have a look at the system functions, especially FileBaseName()

Not applicable
Author

what does -1 in subfield(FILENAME, '\', -1)  do?

what will be it's result?

Thanks,

Boris

sundarakumar
Specialist II
Specialist II

Please find the attachment..

hope this helps.

-Sundar

swuehl
MVP
MVP

It takes the part of the string starting from the end till the first occurence of the delimiter '\'.