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

Creating a dynamic straight table from load script table

All -

Trying to figure out a way to create a straight table box chart on the Main sheet as the document opens, and dynamically add the fields in the table created in a loadscript. The reason for this is that the table in loadscript is drawn from Oracle metadata tables and the field list will be variable.

the painfully manual alternative is to manually create the chart each time there is a change in the underlying table structures.

Any insight appreciated. Thanks,

Chris

15 Replies
sparur
Specialist II
Specialist II

first try to reload script, then press button.

I have a QV 9.0 SR2 but this code worked also in 8.5

Not applicable
Author

I thought that would work once you mentioned it, but no dice.

sparur
Specialist II
Specialist II

may be it's bug in your QV Build?

Can you try this example on QV 9 SR1 ?

Not applicable
Author

I agree. Downloading the update. Anyhow thanks for your help!

Not applicable
Author

Hi Guys,

I tried it and I got the same error. I doubt that we both have a bg in te build.

Not applicable
Author

Hi, I got the same error too.

I finally managed to get it to work, although the "solution" seems a little odd ...


sub chartmaker()
set tbl = ActiveDocument.Sheets(0).CreateStraightTable
tbl.AddExpression "sum(Amount)" 'add expressions first
tbl.AddDimension "Product"
set tbl = nothing
end sub


After stretching the code in many ways, I noticed that it would make it just by swapping two lines in Anatoly's code (ie adding expressions first, and then dimensions).

Hope this will help

Hilaire