Skip to main content
Announcements
Introducing Qlik Answers: A plug-and-play, Generative AI powered RAG solution. READ ALL ABOUT IT!
cancel
Showing results for 
Search instead for 
Did you mean: 
HTaher
Contributor III
Contributor III

read all files from a Space and load them one after the other

Dear Cummunity,

I have a problem and hope you can help me.

I have many CSV files in one a Space. "DKV_SIS 2023-01-01.csv", "DKV_SIS 2023-01-02", "DKV_SIS 2023-01-03", ....

I would like to create an app where all CSV files are dynamically saved in a new QVD.

To do this, I need to be able to read out how many files there are in the Space and what the files are called.

Then load the individual CSVs with a loop and then save them in a QVD.

Is it possible to read all files from a Space and load them one after the other?

I use Qlik Sense Saas.

Thank you very much

Handren

Labels (1)
  • SaaS

1 Solution

Accepted Solutions
Bjorn_Wedbratt
Former Employee
Former Employee

Hi @HTaher ,

You could try something like

for each file in FileList('lib://YourSpace:DataFiles/DKV_SIS*.csv')
	load '$(file)' as Name AutoGenerate 1;
    mydata:
	load * from  ['$(file)'] (txt, utf8, embedded labels, delimiter is ',');
next file

store mydata into ['lib://YourSpace:DataFiles/mydata.qvd'];

 

See if that works.

Best

Björn

View solution in original post

2 Replies
Bjorn_Wedbratt
Former Employee
Former Employee

Hi @HTaher ,

You could try something like

for each file in FileList('lib://YourSpace:DataFiles/DKV_SIS*.csv')
	load '$(file)' as Name AutoGenerate 1;
    mydata:
	load * from  ['$(file)'] (txt, utf8, embedded labels, delimiter is ',');
next file

store mydata into ['lib://YourSpace:DataFiles/mydata.qvd'];

 

See if that works.

Best

Björn

HTaher
Contributor III
Contributor III
Author

Thank You @Bjorn_Wedbratt 

That worked.

best regards

Handren