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

Announcements
Learn how to migrate to Qlik Cloud Analytics™: On-Demand Briefing!
cancel
Showing results for 
Search instead for 
Did you mean: 
hugmarcel
Specialist
Specialist

Macro to set name of pivot expression

Hi

set chart = ActiveDocument.Activesheet.CreatePivotTable

chart.AddDimension "Product"

chart.AddDimension "ProductGroup"

chart.AddExpression "sum(Amount)"

set cp = chart.GetProperties

cp.TableProperties.PivotTableTotalPosition = 0   'top

chart.SetProperties cp

works fine. How to change the name of expression "sum(Amount)" to "Total Amount" in this pivot?

Thx - Marcel

1 Solution

Accepted Solutions
Not applicable

try this

set expr = cp.Expressions.Item(0).Item(0).Data.ExpressionVisual

expr.Label.v = "Sales"

View solution in original post

2 Replies
Not applicable

try this

set expr = cp.Expressions.Item(0).Item(0).Data.ExpressionVisual

expr.Label.v = "Sales"

hugmarcel
Specialist
Specialist
Author