Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Hello,
I have the followin gcode to change the label for Expressions in a Straight Table using VB macro (QV 10).
'rename an expression label
set p = chart.GetProperties
set exps = p.Expressions
set expItem = exps.Item(i).Item(0).Data.ExpressionVisual
expItem.Label.v = expSelection.Item(i).Text
I need to be able to do the same for my dimensions. But, I cannot seem to make it work for dimension labels. Can anyone direct me to the appropriate code?
I was able to piece an answer together myself using information in the following discussion:
http://community.qlik.com/thread/33307
My final code is:
set dimSelection = ActiveDocument.fields("Dimension").GetPossibleValues
set dimName = ActiveDocument.fields("DimensionName").GetPossibleValues
for i=0 to dimSelection.Count - 1
chart.AddDimension dimSelection.Item(i).text
'rename an expression label
set p = chart.GetProperties
set dims = p.Dimensions(i)
dims.Title.v = dimName.Item(i).Text
chart.SetProperties p
SET p=Nothing
Thanks!
I was able to piece an answer together myself using information in the following discussion:
http://community.qlik.com/thread/33307
My final code is:
set dimSelection = ActiveDocument.fields("Dimension").GetPossibleValues
set dimName = ActiveDocument.fields("DimensionName").GetPossibleValues
for i=0 to dimSelection.Count - 1
chart.AddDimension dimSelection.Item(i).text
'rename an expression label
set p = chart.GetProperties
set dims = p.Dimensions(i)
dims.Title.v = dimName.Item(i).Text
chart.SetProperties p
SET p=Nothing
Thanks!