Qlik Community

New to Qlik Sense

Discussion board where members can get started with Qlik Sense.

Announcements
Talk to Experts, a LIVE Q&A Webinar. Bring your Qlik Sense Business questions on Aug. 4th. Register
cancel
Showing results for 
Search instead for 
Did you mean: 
Highlighted
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
Highlighted
Master
Master

Re: Fetch data

@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 "

View solution in original post

2 Replies
Highlighted
Master
Master

Re: Fetch data

@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 "

View solution in original post

Highlighted
Contributor III
Contributor III

Re: Fetch data

Thanks alot, it's working !