Many times users will have such a need, is qlikview design a good pivot table, if directly with the Qlikview Send to Excel function, then the export has no pivot table effect, such as
Then I use a macro to export this pivot table, after the export format and Qlikview consistent, the code is as follows:
Sub Export
Set xlapp = CreateObject ("Excel.Application") ' Define Object
Xlapp.visible = True ' Visible set as True
Set xldoc = XLApp.Workbooks.Add ' Open New workbook
Set table = Activedocument.getsheetobject ("CH03") ' CH03 is the object ID
Set xlsheet = xldoc.worksheets (1) ' Select sheet where data should be pasted
Table. Copytabletoclipboard true ' Copy data to Clipboard
Xlsheet.paste Xlsheet.range ("A1") ' Paste data into cell '
End Sub
In this code, my Pivot Table object is "CH03" so that I can finish exporting the pivot table.
Qlikview export pivot table using VBS