
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
STORE TABLE TO CSV
Hi,
I need to export a table (created from a concatenation of several files) from QlikSense to .csv format.
I tried the code below:
For each file in FileList ('lib://DIRECTORY/*file_name*.xlsx')
"TABLE":
LOAD * FROM [$(file)] (ooxml, embedded labels, table is sheet1);
NEXT;
STORE "TABLE" INTO lib://DIRECTORY/file_name.csv (txt);
The problem is that the file_name.csv created is way too big compared to the input (8 excel files for a total of 50MB generate a .csv for 1600MB) and it crashes when I open it.
I tried also deleting the '(txt)' but the .csv comes out in a format I can't understand.
Thank you very much for your help!
Accepted Solutions

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Try the auto concatenate again, but then with the following Store statement:
STORE [YourField] FROM MyTable
INTO ..\[YourPath]\MyCSVFile.csv (txt);
By doing this you only will save one field. Do this field by field a see which one is giving the problem.
Jordy
Climber

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Before storing this file, did you check on Qlik (with an table or by the data manager) if the created table was according to your expectations? I guess all tables are exactly the same fields (your goal being automatic conactenation with regard to your script)?
cordially.

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hello,
Yes, all the file uploaded have the same structure, so they concatenate easily in the only TABLE.
I also tried to create a table with all the dimensions and the resulting excel dimension is basically the sum of the input files (but I can't use this method because I need to work on a different set of data from excels with hundreds of columns...)
Thanks

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
What happens when you store it in a QVD? Does it get the same size?
Jordy
Climber

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Waiting for your return.

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hi,
If I store the 50 MB excels into a .qvd the size is 8MB.

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hi,
I tried uploading the files 1 by 1 but the result didn't change (still 1.6GB .cvs file).

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Try the auto concatenate again, but then with the following Store statement:
STORE [YourField] FROM MyTable
INTO ..\[YourPath]\MyCSVFile.csv (txt);
By doing this you only will save one field. Do this field by field a see which one is giving the problem.
Jordy
Climber

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Try this :
- Use your loop and store file to qvd format (8 MB)
- Reload this qvd in your application and store it in csv format.
If you obtain the same preceding file size (1600 MB), it may be normal (especially since you have a lot of columns, it requires a lot of memory).
cordially.

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Thank you!
