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

Announcements
Join us in Toronto Sept 9th for Qlik's AI Reality Tour! Register Now
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

Container object always show the first chart

Hi,

I have two charts in container object. i want to show the first chart as default always.

But if i select the second chart and save the document and open again it is showing the second one.

i want show the first chart as default.

Thanks in advance.

2 Replies
gandalfgray
Specialist II
Specialist II

That's simple - always select the first chart before saving then... 

Otherwise maybe it could work if you use an OnOpen trigger with the ActivateObject action. (have not tried it myself)

hope this helps

/Gandalf

Not applicable
Author

For setting the default index of the container when opening the document, create a new action as follows.

1. In the main menu, go to Settings\Document Properties

2. In the Document properties window, go to the Triggers tab, click on the OnOpen option in the Document Event Triggers window and click on the Edit Action button.

3. In the Actions window, add a new External\Run Macro action and then enter the macro name SetContainerIndexDefault

Use this macro for setting the default index. Note that you must replace "CT06" with the Object Id chosen to be the default in your container.

sub SetContainerIndexDefault

Set ContainerObj= ActiveDocument.GetSheetObject("CT06")

Set ContainerProp=ContainerObj.GetProperties     

ActiveChartIndex=0

ContainerProp.SingleObjectActiveIndex = ActiveChartIndex

ContainerObj.SetProperties ContainerProp

End Sub

Default_index_container.PNG.png