Skip to main content
Announcements
Have questions about Qlik Connect? Join us live on April 10th, at 11 AM ET: SIGN UP NOW
cancel
Showing results for 
Search instead for 
Did you mean: 
montubhardwaj
Specialist
Specialist

Fields in MultiBox

Hi all,

I have a multibox and a set of charts in my QV application. The problem  is when I select Chart1, Multibox should show all the fields(i.e. Accounts,Day, Month and Year). But as soon as I open/select Chart2/Chart3, the Multibox should exclude Accounts field from there and should show only Day, Month and Year.

Any Idea how to do this using Trigger/Macros? Simplest way to do this?

PFA the sample attached.

Regards,

Sharma

10 Replies
gandalfgray
Specialist II
Specialist II

Hi Sharma

Attached is a variant you may be able to use.

The idea is to let the application have two states, which you switch between using a button.

You have a new multibox, this one without the Accounts field.

then you add Show condition expressions for the charts and multiboxes, so that

when state 1 is choosen, the original multibox and chart 1 is visible, and when state 2 is choosen the new multibox without Accounts is visible and chart 2 and chart 3.

The buttons action is just to set the value of the variable vState to 1 or 2.

I don't know what you want to do if the user has done any selection in the Accounts field.

If you want to clear that field you need to add an action for that in the button also.

Another solution can be to move chart 2 and 3 to a new tab, and create a multibox there without Accounts,

just a few suggestions

hth/gg

montubhardwaj
Specialist
Specialist
Author

Hi hth/gg,

Thanks for your suggestion. Yes this one is working fine but I don't want to use the button to choose the states. Is there any way I can do it without the use of this button? I mean is there some way to do it dynamically?

Thanks for your suggestion.

Regards,

Sharma

swuehl
MVP
MVP

Hi Sharma,

how do you determine which chart to show? Is there any logic behind? Or does the user choose which chart he/she wants to see?

I assume you are not going to show chart1 and chart2/chart3 at the same time, because then you need to answer which fields the multi box needs to show (maybe all, then?).

If you want them to be shown in an XOR way, you might use auto minimize on the objects instead of using the button. But then you probably need to retrieve the maximize/minimize state by macro and maybe set a variable to control the multi box(es). Sounds quite challenging..

Regards,

Stefan

montubhardwaj
Specialist
Specialist
Author

Hello Stefan,

No, there is no logic for showing the chart. User can choose the chart they want. But at a time, only one chart will be shown(auto minimize is enabled).

For example, I have four charts(c1,c2,c3,c4) and out of them, 3 are minimized and one is shown(c1 is shown). So when c1 is shown, all the fields in mulibox should be shown but as the user is selecting another chart(c2/c3/c4), Accounts field should not be shown in the Multibox.

You are right! I need to retrieve the maximize/minimize state by macro and maybe by using triggers(?).

Thanks for looking into it and let me know if you get it.

Regards,

Sharma

swuehl
MVP
MVP

Hi Sharma,

well, I haven't used that before, and I think I remember that retrieving that maximize state information via macro may not work very well, but you could search the forum / API guide to look how to read that kind of information, e.g. like described here:

http://community.qlik.com/message/18367#18367

You would probably need to call the macro from an appropiate action, triggered by some kind of document / sheet event. Unfortunately there is no OnMinimize / OnMaximize event.

I tried to build a sample, please see attached. It is triggered on OnActivate on any object and then call a Macro to evaluate the Maximize state and set the variable to show / hide the correct multi box.

It works - if you activate any objects after maximizing a chart, i.e. try to open e.g. chart1 by double clicking, the multi box is not correct. Then, after only activating any other object, the multi box is displayed correctly. That's because I haven't found the correct event yet.

You may try something like suggested my Miguel here:http://community.qlik.com/message/104041#104041 but I think that will not work really well on different chart table layouts / sizes.

So I think this is only a starting point,

Regards,

Stefan

montubhardwaj
Specialist
Specialist
Author

HI Stefan,

Thanks for looking into it and for your suggestions. But as you said, I can see that its not working properly. Even if the chart is maximized and if we just click on another chart(not maximizing it), the functionality goes away and it doesnt work anymore.

Is there any macro which suits the requirement? I am currently looking at the links you suggested.

Regards,

Sharma

montubhardwaj
Specialist
Specialist
Author

hi...did u guys have some idea about it?

swuehl
MVP
MVP

Hi,

well I think the macro is working fine, it's just not triggered at the correct moment (and I still don't see an appropriate event on which can trigger, since OnMaximize or OnMinimize don't exist). I found another thread that came to the same conclusion:

http://community.qlik.com/message/30804#30804

Attached is another try using buttons, similar to GandalfGray's version, but more simulating minimized icons (so you can open your chart with one click each and the multi box gets adapted accordingly).

I don't see any completely working solution using a macro right now.

Regards,

Stefan

montubhardwaj
Specialist
Specialist
Author

Hi Swuehi, Yes you are right. But I am not able to get it work the way I want it.