10 Replies Latest reply: Sep 22, 2011 2:35 AM by Dinesh Kumar RSS

Fields in MultiBox

Dinesh Kumar

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

  • Re: Fields in MultiBox
    GandalfGray

    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

    • Fields in MultiBox
      Dinesh Kumar

      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

      • Fields in MultiBox
        swuehl

        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

        • Fields in MultiBox
          Dinesh Kumar

          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

          • Re: Fields in MultiBox
            swuehl

            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