Skip to main content
Announcements
Global Transformation Awards! Applications are now open. Submit Entry
cancel
Showing results for 
Search instead for 
Did you mean: 
rmadursk
Contributor III
Contributor III

FileList with Wildcard not working as expected in Qlik Cloud app

I'm looking for some help with working on multiple files in a datafiles connection.  In Qlik Sense I was able to use '*' in filenames to load data with no issues.  I understand that functionality isn't supposed to work in the Cloud version.

What I'm seeing is not consistent with that.

I have an app that seems to work (sort of) using this syntax:

// Define the file path
LET vFilePath = 'lib://My_Data_Path:DataFiles/';
 
// Loop through each file in the directory
FOR EACH vFile IN FileList('$(vFilePath)*.xls')
TRACE $(vFile);
 
[My_Table]:
LOAD
...
 FROM [$(vFile)]
(ooxml, embedded labels, table is [My_Table]);
 
NEXT vFile;

 

Pretty basic stuff pulled from these forums.  The problem is because the lib://My_Data_Path:DataFiles/ is a flat space with no subfolders it wants to load all files and errors out when it doesn't recognize the data.  

When I put a clarifier in there:

FOR EACH vFile IN FileList('$(vFilePath)*App Data.xls')

the vFile var ends up as <Null> and it errors out.  

BTW, the filenames are similar to this:

Jul 2024 App Data.xls

I have tried multiple changes to try to figure this one out like getting rid of the spaces, moving the date to the end of the filename, and others that I can't recall at the moment.

This worked perfectly in Qlik Sense 😞

I am working on creating a better file source location, but this is going to be an issue when I get to the app that has multiple repeating filenames with different dates.

Labels (1)
  • Cloud

1 Solution

Accepted Solutions
rwunderlich
Partner Ambassador/MVP
Partner Ambassador/MVP

It works for me on Cloud. One difference from on-prem is that the filenames are case sensitive in Cloud, insensitive on-prem.

"*App Data.xls" will match "xyz app data/xls" on-prem, not on Cloud.

Even when I don't have matches, I don't get null issue you mentioned. Perhaps look at the script log to see if there are other clues?

-Rob

View solution in original post

2 Replies
rwunderlich
Partner Ambassador/MVP
Partner Ambassador/MVP

It works for me on Cloud. One difference from on-prem is that the filenames are case sensitive in Cloud, insensitive on-prem.

"*App Data.xls" will match "xyz app data/xls" on-prem, not on Cloud.

Even when I don't have matches, I don't get null issue you mentioned. Perhaps look at the script log to see if there are other clues?

-Rob

rmadursk
Contributor III
Contributor III
Author

The filenames did have one character that was off what I was looking for. 👀  

Thanks again.