Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Hi,
i'm trying to use some vbscript in Qlikview and i feel the model is quite difficult.
What i would like to do :
i want to open a document, list all the listboxes only and add the "Frequency in percent" to all of them.
I can't even find how to have an easy list of all listboxes in the document..
can you help me ?
Thanks
Try something like this
sub abc()
for j= 0 to ActiveDocument.NoOfSheets - 1
set s=ActiveDocument.Sheets(j)
lboxes=s.GetListBoxes
for i=lbound(lboxes) to ubound(lboxes)
set box=lboxes(i).GetProperties
box.Layout.ShowFrequency = true
box.Layout.FrequencyInPercent = true
lboxes(i).SetProperties box
next
next
end sub
Try something like this
sub abc()
for j= 0 to ActiveDocument.NoOfSheets - 1
set s=ActiveDocument.Sheets(j)
lboxes=s.GetListBoxes
for i=lbound(lboxes) to ubound(lboxes)
set box=lboxes(i).GetProperties
box.Layout.ShowFrequency = true
box.Layout.FrequencyInPercent = true
lboxes(i).SetProperties box
next
next
end sub
that's excellent ! Thanks, very nice example.
And just one more thing : if i wanted to add expressions to my listbox, what is the syntax ?
addExpression doesn't seem to work with listboxes .. and properties.expressions.add seems not good ...
thanks
It was a hard one, took me a bit
Set lst = b.GetSheetObject("LB03")
Set c = lst.GetProperties.Expressions
c.Add
Set x = c.Item(c.Count - 1)
x.Data.ExpressionData.Definition.v = "sum(SalesAmount*2)"
great !
scripting is sometimes quite tricky but so powerful !
thanks Daniel