Skip to main content
Announcements
Join us at Qlik Connect for 3 magical days of learning, networking,and inspiration! REGISTER TODAY and save!
cancel
Showing results for 
Search instead for 
Did you mean: 
ced_foning
Contributor III
Contributor III

Fetch data

Hello, 

i have a little problem here
I have a bunch of files in CSV (See picture below)

Capture.PNG

What i want to have is a script code that can : 
do through this folder, dans get these files, knowing that the year, month changes. After this, a qvd file should be created by csv file with the name CVARiskReport.V5_YYYYMM.qvd (where YYYYMM correspond to the Year and month of the original CSV file. 

 

Thanks alot

Labels (2)
1 Solution

Accepted Solutions
Taoufiq_Zarra

@ced_foning 

One solution :

In qliksense you can change c:\... by Lib ...

So, suppose I have this folder :

Capture.PNG

Folder of CSV is : .\Qlik_comm and I want to save QVD into .\Qlik_comm, the script :

 

let path_AllesQVD = '.\Qlik_comm\';
let path_Alles = '.\Qlik_comm\*.csv';

for each File in filelist (path_Alles)

     let vQVDFile=left(right('$(File)',29),23) ;
      Data:
      
      LOAD * FROM  $(File) (txt, codepage is 1252, embedded labels, delimiter is '\t', msq);
      
	 Store Data into '$(path_AllesQVD)$(vQVDFile).qvd' (qvd);
	 
	 drop table Data;
	 
next File 

 

after Reload :

Capture.PNG

 

 

Regards,
Taoufiq ZARRA

"Please LIKE posts and "Accept as Solution" if the provided solution is helpful "

(you can mark up to 3 "solutions") 😉

View solution in original post

2 Replies
Taoufiq_Zarra

@ced_foning 

One solution :

In qliksense you can change c:\... by Lib ...

So, suppose I have this folder :

Capture.PNG

Folder of CSV is : .\Qlik_comm and I want to save QVD into .\Qlik_comm, the script :

 

let path_AllesQVD = '.\Qlik_comm\';
let path_Alles = '.\Qlik_comm\*.csv';

for each File in filelist (path_Alles)

     let vQVDFile=left(right('$(File)',29),23) ;
      Data:
      
      LOAD * FROM  $(File) (txt, codepage is 1252, embedded labels, delimiter is '\t', msq);
      
	 Store Data into '$(path_AllesQVD)$(vQVDFile).qvd' (qvd);
	 
	 drop table Data;
	 
next File 

 

after Reload :

Capture.PNG

 

 

Regards,
Taoufiq ZARRA

"Please LIKE posts and "Accept as Solution" if the provided solution is helpful "

(you can mark up to 3 "solutions") 😉
ced_foning
Contributor III
Contributor III
Author

Thanks alot, it's working !