Skip to main content
Announcements
Qlik Connect 2024! Seize endless possibilities! LEARN MORE
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

1 Solution

Accepted Solutions
sparur
Specialist II
Specialist II

may be it's bug in your QV Build?

Can you try this example on QV 9 SR1 ?

View solution in original post

15 Replies
sparur
Specialist II
Specialist II

Hi, Chris.

I think that you should create a macros, which will dynamic create a chart Object. See more details in APIguide.qvw.

But it's good idea only if you know WHAT fields are DIMENSIONs and what fields are MEASUREs (for using in expression tab)

best regards, Anatoly.

Not applicable
Author

I agree that I should be able to, but all I get with the macros is the gray bar indicating that the chart object is created, with no error for the rest of the code, but no fields added to the chart:

Sub make_chart

set chart = ActiveDocument.GetSheet(1).CreateStraightTable

chart.AddDimension(DEAL_CD)

chart.AddExpression(DEAL_NAME)

End Sub

Any thoughts on how to get this to work? The DEAL_CD, DEAL_NAME are fields created in a table in the load script.

Not applicable
Author

have also tried this to same effect (creates gray bar but no fields)

chart.AddDimension "DEAL_CD"

sparur
Specialist II
Specialist II

Hi, Chris.

Look at my example (in attachments)

regards, Anatoly

Not applicable
Author

That does the same thing, just created the stub of a Straight Table - the top bar with min/max controls on the right. With no fields/columns in it.

Not applicable
Author

Is there something subsequent to this step to add the data from the table that was created in the load script?

I also opened the table and on the dimension tab, no dimensions are added. On the expression tab, no expressions are added.

sparur
Specialist II
Specialist II

what version Do you use?

Because? after I pressed the button, I see a good straight Table:

regards, Anatoly

Not applicable
Author

9.00.7119.4

Not applicable
Author

This is what happens:

Edit Module Box pops up and the stub of a table is created: