Qlik Community

New to Qlik Sense

Discussion board where members can get started with Qlik Sense.

Announcements
Talk to Experts, a LIVE Q&A Webinar. Bring your Qlik Sense Business questions on Aug. 4th. Register
cancel
Showing results for 
Search instead for 
Did you mean: 
Highlighted
Creator
Creator

Re: Export table to .csv using STORE command in script

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);

Highlighted
Creator
Creator

Re: Export table to .csv using STORE command in script

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).

Highlighted
Creator
Creator

Re: Export table to .csv using STORE command in script

Does anybody have a further feedback?

Highlighted
Creator
Creator

Re: Export table to .csv using STORE command in script

May be some experts help

tresesco

kavita25

swuehl

jagan

ahmar811

Highlighted

Re: Export table to .csv using STORE command in script

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

Highlighted
Partner
Partner

Re: Export table to .csv using STORE command in script

Try this, might help..

Store DimKanban into 'lib://Microsemi EDI_Schema (win-n5h9rv84sq3_administrator)/testcsv.csv(txt)';

Highlighted
Creator
Creator

Re: Export table to .csv using STORE command in script

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,

Highlighted
Creator
Creator

Re: Export table to .csv using STORE command in script

Hi Avinash,

Sure, Attached is a zip file with the following:

  • Qvd of the table I try to export to CSV
  • The app file, which I created in QS server
Highlighted
Partner
Partner

Re: Export table to .csv using STORE command in script

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)';

Highlighted
Partner
Partner

Re: Export table to .csv using STORE command in script

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.

View solution in original post