Qlik Community

QlikView Scripting

Discussion Board for collaboration on QlikView Scripting.

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
MVP
MVP

Re: compare variable to file name without extension and folders

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()

4 Replies
MVP
MVP

Re: compare variable to file name without extension and folders

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

Re: compare variable to file name without extension and folders

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

what will be it's result?

Thanks,

Boris

sundarakumar
Valued Contributor II

Re: compare variable to file name without extension and folders

Please find the attachment..

hope this helps.

-Sundar

MVP
MVP

Re: compare variable to file name without extension and folders

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

Community Browser