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

Announcements
Qlik Open Lakehouse is Now Generally Available! Discover the key highlights and partner resources here.
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.