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

Announcements
Write Table now available in Qlik Cloud Analytics: Read Blog
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

Help with VBScript AddExpression

I quickly put this code together to build an expression to produce a full dataset based upon all bookmarks. The code works and builds the expression fine, but when it adds it to the chart, the chart displays a big X.

If I then edit the properties of the chart and close the dialogue window without changing any settings it loads the correct data. Do I need to refresh / requery the chart with the script? What am I missing?

<pre>sub outputBookmarks
bookmarks = ActiveDocument.GetDocBookmarkNames

for i = 1 to UBound(bookmarks)
strSetExp = strSetExp & "[" & bookmarks(i) & "]+"
next

strSetExp = Left(strSetExp,Len(strSetExp)-1)
strSetExp = "{" & strSetExp & "}"

set objST = ActiveDocument.GetSheetObject("CH89")
objST.AddExpression "Sum(" & strSetExp & "NET_Amount)"
end sub


0 Replies