Skip to main content
Woohoo! Qlik Community has won “Best in Class Community” in the 2024 Khoros Kudos awards!
Announcements
Nov. 20th, Qlik Insider - Lakehouses: Driving the Future of Data & AI - PICK A SESSION
cancel
Showing results for 
Search instead for 
Did you mean: 
anushka_iconresources
Contributor II
Contributor II

Loading multiple files in Qlik Cloud

Hi Everyone,

 

I am trying to load multiple files in Qlik cloud using the following format from Sharepoint Connection

"FROM [lib://DEV:Office_365_Sharepoint - TEST/Datasource/Care/New Case/Listing/PatientListing*.csv]
(txt, utf8, embedded labels, delimiter is ',', msq);"

File name is PatientListing_DDMMYYYY, and i would like to load all the files.

Can someone please suggest a way to load all these files at once.

Regards

 

Labels (2)
8 Replies
SunilChauhan
Champion II
Champion II

try with underscore

"FROM [lib://DEV:Office_365_Sharepoint - TEST/Datasource/Care/New Case/Listing/PatientListing_*.csv]
(txt, utf8, embedded labels, delimiter is ',', msq);"

 

or share the error message?

Sunil Chauhan
anushka_iconresources
Contributor II
Contributor II
Author

Still giving error with underscore
 
Cannot open file: 'lib://DEV:Office_365_Sharepoint - TEST/Datasource/Care/New Case/Listing/PatientListing_*.csv' (Connector error: Failed on attempt 1 to GET. (-2147024894, System.IO.FileNotFoundException, File Not Found.))
anushka_iconresources
Contributor II
Contributor II
Author

Still Giving error with underscore

Cannot open file: 'lib://DEV:Office_365_Sharepoint - TEST/Datasource/Care/New Case/Listing/PatientListing_*.csv' (Connector error: Failed on attempt 1 to GET. (-2147024894, System.IO.FileNotFoundException, File Not Found.))
sitemasdipac
Contributor II
Contributor II

Buenos Dias,

Por favor indicar si solucionaron esta novedad..

Gracias

anat
Master
Master

For each File in FileList('$(vFileName) & '\*' & '.csv')
   trace $(File);
   Load * From [$(File)] (txt, codepage is 28591, embedded labels, delimiter is ';', no quotes);
Next File

marksouzacosta

I don't think you can do that since this is not a regular Windows folder where you can use wild characters. 
You have to enter the names manually or I maybe there is some short of metadata feature where you can list the file names inside your SharePoint.

Read more at Data Voyagers - datavoyagers.net
TauseefKhan
Creator III
Creator III

Hi @anushka_iconresources 
Use a loop to iterate through the files.

// Define the file path
LET vFilePath = 'lib://DEV:Office_365_Sharepoint - TEST/Datasource/Care/New Case/Listing/';

// Loop through each file in the directory
FOR EACH vFile IN FileList('$(vFilePath)PatientListing_*.csv')
TRACE $(vFile);
LOAD
*
FROM [$(vFile)]
(txt, utf8, embedded labels, delimiter is ',', msq);
NEXT vFile;


rmadursk
Contributor III
Contributor III

When I try this with my files the vFile var ends up as Null and none of the files are processed. The vFilePath var is correctly assigned to the location of my datafiles. Obviously, since vFile is Null it just skips over my load statements.

// Define the file path
LET vFilePath = '[lib://OCIO Development:DataFiles/';

// Loop through each file in the directory
FOR EACH vFile IN FileList('$(vFilePath)*Data.xls]')
TRACE $(vFile);

Load ...

Next(vFile);

I'm not seeing anything in the docs that would help figure out why that is Null instead of list of filenames.