Skip to main content
Announcements
Join us at Qlik Connect for 3 magical days of learning, networking,and inspiration! REGISTER TODAY and save!
cancel
Showing results for 
Search instead for 
Did you mean: 
raghavsurya
Partner - Specialist
Partner - Specialist

Launching Multiple charts with click of a button

Hi All,

There is a requirement where I need to launch 2 charts which are minimised in the tab with click of one button. I have written a simple macro for the same but it is giving me error. Can anybody help me out.

sub ShowChartRT
ActiveDocument.GetSheetObject("CH395","CH588").restore
end sub

Can anybody suggest the modifications required for this macro.

Regards,

Raghav

9 Replies
Not applicable

Hi Raghav,

Try this..

sub RestoMini

set c=ActiveDocument.GetSheetObject ("CH395")

if c.IsMinimized then

c.Restore

else

c.Minimize

end if

set c=ActiveDocument.GetSheetObject ("CH588")

if c.IsMinimized then

c.Restore

else

c.Minimize

end if

end sub

Hope that'll work..

-Lester

raghavsurya
Partner - Specialist
Partner - Specialist
Author

Hi,

I tried this macro..... but I still notice that only Chart 588 is getting launched. The requirement is to launch both the charts at one shot. Let me explain with an example.

We have around 7 charts..... and I am launching one chart at one go with a click of the button. We have provided 7 buttons.... one for each chart with the name of the chart. Now the user wants to combine 2 charts and launch at one go with click of only button.

Can you please suggest a way.

Thanks in advance.

Regards,

Raghav

Not applicable

Hi Raghav,

It's working fine with me. Anyways, I've attached a sample qvw for your reference. And try to check if the Chart's "Allow Minimize" is checked. See the attached file for your checking..

Hope that could help you solve your problem..

- Lester

raghavsurya
Partner - Specialist
Partner - Specialist
Author

hi,

Thanks for your help. I had checked Auto minimize checkbox as well for the charts, hence it was launching only one chart.

But my requirement if I click on other button different chart should get launched and the chart which is active should get minimised. This can happen only when Auto minimize checkbox is marked as yes.

Is there any workaround.

Thanks and Regards,

Raghav

Not applicable

Hi!

The Auto Minimize of charts should not be checked, its because the macro controls when a chart must me minimized or being restored. I also suggest to just populate the macro script on the .qvw that I've attached on the previous post depending on the charts behavior (minimize or restore). Well, if you could provide me the 7 charts you are talking about and how are they wanted to view in the report then, I can help you further..

-Lester

raghavsurya
Partner - Specialist
Partner - Specialist
Author

<body><p>Hi,</p> <p>Thanks a lot for your kind gesture.  Below are the list of 6 charts</p> <p> <p style="margin:0cm 0cm 10pt;"> <table width="330" cellpadding="0" cellspacing="0" border="0" style="width:248pt;border-collapse:collapse;"> <colgroup><col width="64" style="width:48pt;"></col><col width="202" style="width:152pt;mso-width-source:userset;mso-width-alt:7387;"></col><col width="64" style="width:48pt;"></col></span></colgroup> <tbody> <tr style="height:15pt;"> <td width="64" height="20" class="xl64" style="background-color:transparent;width:48pt;height:15pt;border:#f0f0f0;"><strong>Chart</span></strong></td> <td width="202" class="xl64" style="background-color:transparent;width:152pt;border:#f0f0f0;"><strong>Description</span></strong></td> <td width="64" class="xl64" style="background-color:transparent;width:48pt;border:#f0f0f0;"><strong>Button</span></strong></td> </tr> <tr style="height:15.75pt;"> <td height="21" class="xl63" style="background-color:transparent;height:15.75pt;border:#f0f0f0;">CH408</span></span></td> <td class="xl63" style="background-color:transparent;border:#f0f0f0;">Rev and Margin Trend</span></span></td> <td style="background-color:transparent;border:#f0f0f0;">Button 1</span></td> </tr> <tr style="height:15.75pt;"> <td height="21" class="xl63" style="background-color:transparent;height:15.75pt;border:#f0f0f0;">CH395</span></span></td> <td class="xl63" style="background-color:transparent;border:#f0f0f0;">Revenue Trend</span></span></td> <td style="background-color:transparent;border:#f0f0f0;">Button 2</span></td> </tr> <tr style="height:15.75pt;"> <td height="21" class="xl63" style="background-color:transparent;height:15.75pt;border:#f0f0f0;">CH588</span></span></td> <td class="xl63" style="background-color:transparent;border:#f0f0f0;">Revenue Cost Centrewise</span></span></td> <td style="background-color:transparent;border:#f0f0f0;">Button2</span></td> </tr> <tr style="height:15.75pt;"> <td height="21" class="xl63" style="background-color:transparent;height:15.75pt;border:#f0f0f0;">CH589</span></td> <td class="xl63" style="background-color:transparent;border:#f0f0f0;">Rev Variance CostCentrewise</span></td> <td style="background-color:transparent;border:#f0f0f0;">Button3</span></td> </tr> <tr style="height:15.75pt;"> <td height="21" class="xl63" style="background-color:transparent;height:15.75pt;border:#f0f0f0;">CH630</span></span></td> <td class="xl63" style="background-color:transparent;border:#f0f0f0;">Actual Rev YOY</span></span></td> <td style="background-color:transparent;border:#f0f0f0;">Button4</span></td> </tr> <tr style="height:15.75pt;"> <td height="21" class="xl63" style="background-color:transparent;height:15.75pt;border:#f0f0f0;">CH631</span></span></td> <td class="xl63" style="background-color:transparent;border:#f0f0f0;">Rev Variabce YOY</span></span></td> <td style="background-color:transparent;border:#f0f0f0;">Button5</span></td> </tr> </tbody> </table> </p> <p style="margin:0cm 0cm 10pt;"> </p> </span></p> <p style="margin:0cm 0cm 10pt;">And the requirement is to have 5 buttons.  One for each CH408, CH589, CH630 and CH630.... which makes 4 buttons each of them launching one chart.  The 5th button should launch CH395 and CH588 together. </p> <p>When the user clicks on Button 1 Ch408 should get launched..... if Button 3 is clicked any chart which is displayed in the tab should get minimised and CH589 should be launched.  Its the same requirement for any button...... Just that if Button 2 is launched any chart which is displayed should get minimised and CH588 and CH395 should get launched. </p> <p>Can you please help me in this. </p> <p>Thanks a lot in advance for your kind help. </p> <p>Regards,</p> <p>Raghav</p> <p> </p> <p> </p></body>

Not applicable

Its very easy done with QlikView 9 and Actions.

Make a button with several Restore Object actions.

Not applicable

Hi Raghav,

Please see the attached file. Just as I said, I just populated the macro script across the charts. These buttons are not just launching or restoring the chart, but they are also capable of minimizing them. Remeber, if you will apply this to your charts "DO NOT check AUTO MINIMIZE".

Hope this save lots of time solving your problem..

- Lester

raghavsurya
Partner - Specialist
Partner - Specialist
Author

Hey Buddy......

It really helped........ thanks a lot for your kind help.

Regards,

Raghav