Skip to main content
Woohoo! Qlik Community has won “Best in Class Community” in the 2024 Khoros Kudos awards!
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: 
Not applicable

Change label Expression VBScript

What is the syntax in VBScript to change the label of an Expression. For instance, I add this expression in a Pivot Table:

Hlo.AddExpression "Sum(ExpenseBudget)/1000"

and I would like the Expression to be labelled as "Expense"

3 Replies
luciancotea
Specialist
Specialist

set chart = ActiveDocument.ActiveSheet.CreateStraightTable

chart.AddDimension "Customer"

chart.AddDimension "ProductType"

chart.AddExpression "sum(Amount)"

set cp = chart.GetProperties

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

expr.Label.v = "Sales"

expr.NumAdjust = 1    'center

expr.LabelAdjust = 1    'center

chart.SetProperties cp

Not applicable
Author

thanks for reply

in prop.Expressions.Item(0).Item(0).Data.ExpressionVisual

i understand that prop.Expressions.Item(0) is the first expressions in the list of expressions for this chart. What does the second item(0) refers to ? What is Data and what is ExpressionVisual for ?

Thanks

luciancotea
Specialist
Specialist

First item is the group of expressions, the second is the expression in group.

Look for "API Guide" to understand all the properties.