Skip to main content
Announcements
Have questions about Qlik Connect? Join us live on April 10th, at 11 AM ET: SIGN UP NOW
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

Loading and storing of dynamic csvs to qvds

Hello all,

I have monthly csvs(24 csvs with monthly names) in one folder, which I have to load to appropriate monthly qvds.

I want to make a loop of loading these csvs.

Can anybody help me to build a procedure which loads csvs in a loop to qvds with the same names like csvs?

Thanks a lot!

14 Replies
jonathandienst
Partner - Champion III
Partner - Champion III

Hi

Is this a file in the folder containing the csvs you are loading? But the file list should only match *.csv files.

Is that a script error? Maybe a screen shot would help.

You can debug your script and.or add a trace statement in the line after the For Each...FileList() line to see what you are getting in the variable File:

TRACE File = $(File);

Regards

Jonathan

Logic will get you from a to b. Imagination will take you everywhere. - A Einstein
Not applicable
Author

Hi,

I added trace , but it did not help and does not show me the value at all.

Prtscr is attached.

Thanks for help!!!

Not applicable
Author

Hi,

I fixed a problem. Everything works. Thanks a lot!!!!

jonathandienst
Partner - Champion III
Partner - Champion III

Please post how you solved the problem, because it may help someone else with a similar problem.

Jonathan

Logic will get you from a to b. Imagination will take you everywhere. - A Einstein
Not applicable
Author

Hi, here it is :

SET FilePath='*.csv';

set vFileName = 'file';



for each File in filelist ('C:\Users\innas\Desktop\Qvd\QV_new\daily\' & FilePath)

TRACE File = $(File);

   
SET sFile = '$(File)';

   
Directory;

   NetworkDomainDailyData:

   
LOAD *

   
FROM

    [$(sFile)]

    (
txt, codepage is 1252, embedded labels, delimiter is ',', msq);



store * from NetworkDomainDailyData into C:\Users\innas\Desktop\Qvd\Sql_Data\$(vFileName).qvd(qvd);

drop table NetworkDomainDailyData;



   
next File