Skip to main content
Announcements
Join us at Qlik Connect for 3 magical days of learning, networking,and inspiration! REGISTER TODAY and save!
cancel
Showing results for 
Search instead for 
Did you mean: 
jzimolong
Creator II
Creator II

Loop through straight table charts and export to QVDs

I have been looking or a vb module to loop through a .qvw and export straight table charts to QVD files.  Many of my straight table charts build columns using expressions, so I want to export them to QVD files, then use those QVD files as tables in other QVW files.

I found the following from this Q&A web page:  http://qlikviewnotes.blogspot.com/2011/02qvd-questions-and-answers.html

For i = 1 to NoOfTables()

     LET vTableName = TableName($(i)-1);

     LET vOutfile = '$(vTableName).qvd';

     STORE [$(vTableName)] INTO [$(vOutfile)] (qvd);

NEXT i

Been trying to adapt this to my QVW, but can't even get the module to save properly.  Keep getting stuck on how to get the loop working.  Can this be adapted to look through and find straight table charts?

1 Solution

Accepted Solutions
Gysbert_Wassenaar

Only tables that you create in the script can be exported to qvd's. For chart objects you need a macro. See for example this blog post: QlikTip #32: Exporting multiple QV objects to a single Excel document


talk is cheap, supply exceeds demand

View solution in original post

3 Replies
jzimolong
Creator II
Creator II
Author

Just realized the above belongs in the LOAD script, so I got it working there and is useful for loading all tables into QVD files.

However, can something similar to this be done via macro so I can export my straight table charts to QVD?  Basically, a loop to cycle through charts, identify which are straight table charts, and then export content into QVD.

Gysbert_Wassenaar

Only tables that you create in the script can be exported to qvd's. For chart objects you need a macro. See for example this blog post: QlikTip #32: Exporting multiple QV objects to a single Excel document


talk is cheap, supply exceeds demand
jzimolong
Creator II
Creator II
Author

Thanks for the reply.  I now have a button that sits on top of the CHART object, and when I click it, the contents of the chart are saved to a QVD, by executing the following macro:

Sub ExpQVD

     QVDFile = "C:\Report.qvd"

     set obj = ActiveDocument.GetSheetObject("CH17")

     obj.ExportEx QVDFile, 4

End Sub

Would be nice to have a loop of all charts, where I could export them each in one single process, instead of having to hard code the file names, etc.

I will take a look at the link you provided and see what I can get from that.

Thanks again.