Skip to main content
Announcements
Qlik Community Office Hours - Bring your Ideation questions- May 15th, 11 AM ET: REGISTER NOW
cancel
Showing results for 
Search instead for 
Did you mean: 
Anonymous
Not applicable

Avoiding Synthetic Keys When Loading CSV Files

I'm loading hundresds of CSV files into one QVD by using:

LOAD *

FROM (FilePath)*.CSV

It works fine if they all have same column names but if any of these has an additioanl column then I get synethetis keys. Is there a way to have them in one QVD and still avoid synthetic keys?

1 Solution

Accepted Solutions
Gysbert_Wassenaar

Use the concatenate keyword to force the data to be appended to the same table:

// set the FilePath variable

SET FilePath = 'D:\QVdata\temp\comm75615\';

// create an empty table to concatenate to

load '' as TempField AutoGenerate 0;

concatenate load *

from $(FilePath)*.CSV

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

// drop superfluous field 

drop field TempField;

edit: added some details to make the example more complete


talk is cheap, supply exceeds demand

View solution in original post

3 Replies
Gysbert_Wassenaar

Use the concatenate keyword to force the data to be appended to the same table:

// set the FilePath variable

SET FilePath = 'D:\QVdata\temp\comm75615\';

// create an empty table to concatenate to

load '' as TempField AutoGenerate 0;

concatenate load *

from $(FilePath)*.CSV

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

// drop superfluous field 

drop field TempField;

edit: added some details to make the example more complete


talk is cheap, supply exceeds demand
Anonymous
Not applicable
Author

With that script, it only loads the very first CSV file and I get "execution of script failed" message.

Anonymous
Not applicable
Author

Thank you.