Qlik Community

QlikView Scripting

Discussion Board for collaboration on QlikView Scripting.

Announcements
QlikView Fans! We’d love to hear from you.
Share your QlikView feedback with the product team… Click here to participate in our 5-minute survey.
Rules, plus terms and conditions, can be found here.
jpapador
Valued Contributor

Filelist check for just xls and exlude xlsx

I have written a loop that checks a directory for xls files:

FOR EACH File in FileList('\\SharedDrive\Production\Qlikview\Rebate Data\*.xls')

LET  vXLSExists = 1;

exit for when $(vXLSExists) = 1;

NEXT File;

Works great.  The problem is there are NO .xls files in that directory.  There are a bunch of .xlsx files.  I know the QlikView help says that .xls in a filelist is essentially .xls*.

Is there anyway to change it to only search for .xls?

1 Solution

Accepted Solutions
MVP
MVP

Re: Filelist check for just xls and exlude xlsx

Strange, I never noticed that NOTE in the HELP before.

Try maybe something like

LET  vXLSExists = If(Subfield('$(File)','.',-1)='xls',1,0);

2 Replies
MVP
MVP

Re: Filelist check for just xls and exlude xlsx

Strange, I never noticed that NOTE in the HELP before.

Try maybe something like

LET  vXLSExists = If(Subfield('$(File)','.',-1)='xls',1,0);

jpapador
Valued Contributor

Re: Filelist check for just xls and exlude xlsx

Thank you, that works

Community Browser