Do not input private or sensitive data. View Qlik Privacy & Cookie Policy.
Skip to main content

Announcements
Join us in Bucharest on Sept 18th for Qlik's AI Reality Tour! Register Now
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

Accessing Data Model / Table from Macro

Hi folks,

I am quite new to QlikView. I am trying to create a Co-relation matrix (pivot table). The structure is something like this

Variables   Value A  Value B  Value C

Value A        1             0.3          0

Value B         .48             1             -.25

Value C        0                 .8             1

This might change with each reload (Number of Values may increase or decrease) which will happen once a month.

I am trying to write a Macro where in I will access the underlying qlikview table to have this structure created dynamically.

Public Sub CreateDynamicPivot()
   Set Pivot = ActiveDocument.Sheets("Linear Regression").CreatePivotTable
   Pivot.AddDimension "Variable"

' Trying to loop throug the table to AddExpression based on the table structure
   Pivot.AddExpression "Value A"
   Pivot.AddExpression "Value B"
   Pivot.AddExpression "Value B"

End Sub

Please help out with the best way to achieve this.

Thanks,

Vinay

0 Replies