Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Hi,
My goal is to export a full table to .csv file. In addition, I want to add a delimiter which I determine.
I understood the best/easiest way to do so in Qlik Sense is by using STORE command in the script. No need for VBA macros.
Does anybody have suggestions for the exact syntax?
Thanks!
hi Avinash,
See below, I make a couple of JOINs between QVDs. The last line is where I try to export to CSV, I tried some versions of it (including calling it from 'lib' and Govind suggestions from above)
DimKanban:
LOAD
City,
Country as CountryCode,
KanbanCode,
KanbanName,
State as StateCode,
SubcontractorCode,
SupplierCode
FROM [lib://Global Data DB_Source (win-n5h9rv84sq3_administrator)/Kanban.qvd] (qvd);
Left Join
LOAD
Continent,
CountryCode,
CountryName,
EuropeanRegion,
Region,
"TimeZone" as CountryTimeZone
FROM [lib://Global Data DB_Source (win-n5h9rv84sq3_administrator)/Country.qvd]
(qvd);
Left Join
LOAD
StateCode,
StateName,
"TimeZone" as StateTimeZone
FROM [lib://Global Data DB_Source (win-n5h9rv84sq3_administrator)/State.qvd] (qvd);
Left Join
LOAD
SupplierCode,
SupplierName,
SupplierType
FROM [lib://Global Data DB_Source (win-n5h9rv84sq3_administrator)/Suppliers.qvd] (qvd);
left join
LOAD
SubcontractorCode,
SubcontractorName
FROM [lib://Global Data DB_Source (win-n5h9rv84sq3_administrator)/Subcontractor.qvd]
(qvd);
left join
LOAD
Code as KanbanCode,
PlantTo as Plant,
SlocTo as Sloc
FROM [lib://Microsemi EDI_DB (win-n5h9rv84sq3_administrator)/PlantKanban.qvd]
(qvd);
Store * From DimKanban into [lib://Microsemi EDI_Schema (win-n5h9rv84sq3_administrator)/DimKanban_Temp1.qvd];
Store DimKanban into testcsv.csv(txt);
Hi Justin,
Yes, I did and got the same error. Also tried to create a data connection and use 'lib' with no success (See my response to Avinash).
Does anybody have a further feedback?
I tried with the sample data its working fine for me , not sure what's going in your script ...could you share the sample qvd/ QVF files let me check and get back to you
Try this, might help..
Store DimKanban into 'lib://Microsemi EDI_Schema (win-n5h9rv84sq3_administrator)/testcsv.csv(txt)';
Hi Harish,
Thanks for your reply,
I still get the csv file in the same strange format which I uploaded in my response to Avinash,
Hi Avinash,
Sure, Attached is a zip file with the following:
Those attached files contains the xml format of your data. If you wish try out storing in xls or xlsx to check, then you can try the below,
Store DimKanban into 'lib://Microsemi EDI_Schema (win-n5h9rv84sq3_administrator)/testcsv.xls(txt)';
The issue occurs in your Data connection 'lib://Microsemi EDI_Schema (win-n5h9rv84sq3_administrator).
When you are using single quotes (' ') in the store command for your path, the sense is storing the data in xml, in order to exclude ' ' , avoid the spaces in between the data connections folder or make sure you avoid (win-n5h9rv84sq3_administrator) in the folder data connection name. it will work.
For eg, you Script and Store should command should be as shown below :
DimKanban:
LOAD
KanbanCode,
SubcontractorCode,
SupplierCode,
StateCode,
CountryCode,
City,
KanbanName,
VendorCode,
IsKanbanBlocked,
Continent,
CountryName,
EuropeanRegion,
Region,
CountryTimeZone,
StateName,
StateTimeZone,
SupplierName,
SupplierType,
SubcontractorName,
Plant,
Sloc
FROM [lib://ServerLogFolder/DimKanban_Temp1.qvd]
(qvd);
Store DimKanban into lib://ServerLogFolder/testcsv12.csv (TXT);
And also i have attached the output csv file from this store command.