6 Replies Latest reply: Jan 23, 2018 5:36 PM by Dawn Graese RSS

    Load multiple csv files into one file

    Dawn Graese

      I searched for and tried two suggestions below for loading multiple CSV files at once into a larger single file, but not having success. 


      If someone can point out what I'm missing I would really appreciate it!

       

      Attempt #1:

      vPath = 'lib://AttachedFiles';

      For each file in FileList('$(vPath)\example_data*.csv');

      example_data_1234:

      Load * FROM $(File)[lib://AttachedFiles/example_data*.csv]

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


      Outcome:  The load runs, but Qlik Sense is creating a synthetic key using all the fields instead of making one table and appending with all the following files.  I expected it just be one table and not need a key of any kind.  Is there a way to avoid the synthetic key or does it matter?


      Attempt #2

      example_data_0398:


      LOAD *

      FROM [lib://AttachedFiles/example_DATA_APR1_15.csv];

      Concatenate (example_data_0398);

      LOAD *

      FROM [lib://AttachedFiles/example_DATA_APR16_30.csv]

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


      Outcome: I'm getting an error that says "Unknown statement: Concatenate (example_data_0398)"