Do not input private or sensitive data. View Qlik Privacy & Cookie Policy.
Skip to main content

Announcements
Join us to spark ideas for how to put the latest capabilities into action. Register here!
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

load multiple QVD files

Hi everybody,

     I have folder with many QVD files, which represent whole data model (one qvd file -> one table in data model). I have this code but it only loads all tables into one. Does anybody know why? Thanks for any ideas.

SET vFolder = '.\POLOZKY';

FOR EACH vFileName IN filelist(vFolder& '\*.qvd')

     LET vNameOfTable = QvdTableName('$(vFileName)');

     [$(vNameOfTable)]:     

     load

      *

     from $(vFileName) (qvd);

    

next vFileName

6 Replies
alexandros17
Partner - Champion III
Partner - Champion III

trasform it into:

  1. SET vFolder = '.\POLOZKY'; 
  2. LET I=0; 
  3. FOR EACH vFileName IN filelist(vFolder& '\*.qvd') 
    1. I=$(I)+1
  4.      LET vNameOfTable = QvdTableName('$(vFileName)'); 
  5.  
  6.      [$(vNameOfTable)]_$(I):
    1. noconcatenate       
  7.      load 
  8.       * 
  9.      from $(vFileName) (qvd); 
  10.       
  11. next vFileName 

  12. let me know
Not applicable
Author

Yes, this loads multiple tables, but it does not solve my problem. For each loop in cycle is should load a new table and name of table should by name of file (file .../myTable.qvd -> table name myTable)

Not applicable
Author

transform into

Directory;

SET vFolder = = '.\POLOZKY'; 

 

FOR EACH vFileName IN filelist(vFolder& '\*.qvd') 

 

     LET vNameOfTable = QvdTableName('$(vFileName)'); 

 

     [$(vNameOfTable)]:       

     load 

      * 

     from $(vFileName) (qvd); 

      

next vFileName

Let me know

maxgro
MVP
MVP

SET vFolder = 'C:\Users\yyy\Downloads'; 

 

FOR EACH vFileName IN filelist(vFolder& '\*.qvd') 

 

    LET vNameOfTable = QvdTableName('$(vFileName)'); 

   LETvFileBaseName=replace(subfield('$(vFileName)', '\', -1), '.qvd', '');

  trace vFileName=$(vFileName); 

  trace vFileBaseName=$(vFileBaseName);

  trace vNameOfTable=$(vNameOfTable);

     [$(vFileBaseName)]:       

     load 

      * 

     from $(vFileName) (qvd); 

      

next vFileName 

Anonymous
Not applicable
Author

if  your QVD's  have the  same structure try it.

SET vFolder = '.\POLOZKY';

NameTableqvd:

load

*

From $(vFolder)*.QVD

(qvd);

kwarren1
Partner - Contributor III
Partner - Contributor III

This answers Lucie's Question... and mine! Thanks!