Qlik Community

New to QlikView

Discussion board where members can get started with QlikView.

Highlighted
anselmo_meira
Contributor II

Export table from load script to Excel

Hi all,

I would like to know if it is possible to export data from load script to an excel file as can be done with qvd.

If it is possible, can you provide some examples?

Thanks in advance.

1 Solution

Accepted Solutions
santiago_respane
Valued Contributor

Re: Export table from load script to Excel

You can store in csv format in order to load it from excel (1), or you can have a table box in a hidden sheet with the data you want to export and run a macro that exports to excel after the script runs (2).

1-Store command:

STORE YourTableName into YourFile.csv (txt);


2-Macro:

sub Export

  on error resume next

  Set obj = ActiveDocument.GetSheetObject("ID OF THE TABLE TO EXPORT")

  vPath = "Path to the excel file"

  vName = "Name of the excel file"

  set filesys=CreateObject("Scripting.FileSystemObject")

  If Not filesys.FolderExists(vPath) Then

    Set newfolder = filesys.CreateFolder(vPath)

  End If

  obj.ExportBiff vPath & vName

  Set obj = nothing

end sub

Hope this helps.

Kind regards,

3 Replies
trdandamudi
Honored Contributor II

Re: Export table from load script to Excel

You can export to .txt file and then you can open in Excel.

store MyData into Samplefile.txt (txt);

santiago_respane
Valued Contributor

Re: Export table from load script to Excel

You can store in csv format in order to load it from excel (1), or you can have a table box in a hidden sheet with the data you want to export and run a macro that exports to excel after the script runs (2).

1-Store command:

STORE YourTableName into YourFile.csv (txt);


2-Macro:

sub Export

  on error resume next

  Set obj = ActiveDocument.GetSheetObject("ID OF THE TABLE TO EXPORT")

  vPath = "Path to the excel file"

  vName = "Name of the excel file"

  set filesys=CreateObject("Scripting.FileSystemObject")

  If Not filesys.FolderExists(vPath) Then

    Set newfolder = filesys.CreateFolder(vPath)

  End If

  obj.ExportBiff vPath & vName

  Set obj = nothing

end sub

Hope this helps.

Kind regards,

anselmo_meira
Contributor II

Re: Export table from load script to Excel

Thanks santiago.respaneIt worked perfectly.