Qlik Community

QlikView Scripting

Discussion Board for collaboration on QlikView Scripting.

Not applicable

Export to CSV

Hi everyone!!

Today i'm trying to export some straight table to CSV file.

I read some discussion here or in other forums, and all suggested to use macro.

I did some tests following their suggestions, but in any case I've found a method that works.

Can someone explain the correct way to export one or more tables in a csv file ??

Thanks

Tags (3)
1 Solution

Accepted Solutions

Re: Export to CSV

Try this simple macro:

sub exportcsv

set sObject = ActiveDocument.GetSheetObject("CH04")

sObject.Export "c:\myfile.csv", ", "

end sub

where CH04 is the table you want to export

6 Replies
dfoster9
Valued Contributor

Re: Export to CSV

One of the options on the STORE command is CSV.

STORE <table> INTO C:\temp\table.csv (CSV);

Re: Export to CSV

Try this simple macro:

sub exportcsv

set sObject = ActiveDocument.GetSheetObject("CH04")

sObject.Export "c:\myfile.csv", ", "

end sub

where CH04 is the table you want to export

MVP
MVP

Re: Export to CSV

Hi,

You need to use macro to export chart data to CSV or export the chart to excel and click Save As and select file type as CSV.

SUB ExportChartToCSV

     SET  objChart = ActiveDocument.GetSheetObject("CH01")

     objChart.Export "C:\Data.CSV", ", "

END SUB

Regards,

Jagan.

ngulliver
Valued Contributor III

Re: Export to CSV

Hi, David.

Just a minor correction. I think it should be:

STORE <table> INTO C:\temp\table.csv (txt);


Cheers,

Neil

deepaktibhe
Valued Contributor

Re: Export to CSV

Hi Jagan,

How to export chart data to csv for more than one chart.

Thanks

MVP
MVP

Re: Export to CSV

Hi,

Try like this

SUB ExportChartToCSV

     SET  objChart = ActiveDocument.GetSheetObject("CH01")

     objChart.Export "C:\Data1.CSV", ", "

SET  objChart = ActiveDocument.GetSheetObject("CH02")

     objChart.Export "C:\Data2.CSV", ", "

SET  objChart = ActiveDocument.GetSheetObject("CH03")

     objChart.Export "C:\Data3.CSV", ", "

END SUB


Note : One CSV file can hold only one table data.


Hope this help syou.


Regards,

Jagan.

Community Browser