2 Replies Latest reply: Oct 23, 2012 8:05 PM by John Witherspoon RSS

    Hot Button to make selection and then deselect when exiting the tab

    lin ye

      Hi I want to create a button for selection in Qlikview 10, Sorry I have to use qlikview 10 because the outdated server the company uses.

       

      There is a field call S_flag which contains these possible values ('O', ' ', 'A', 'B'). I want to exclude all order with S_flag O in all except one tab. So i want to exclude that value on all other tab, and on the tab I want it, click on the button to include it. When i exit the tab, it will exclude it again. I don't want to clear all, because there are other filters I set, don't want to clear those.

       

      Thanks

        • Re: Hot Button to make selection and then deselect when exiting the tab
          John Witherspoon

          It would be straightforward to use actions to select A, B and blank when leaving the tab, and clear selections in that field when entering the tab.  However, I'm guessing you still want the users to be able to select values in that field and not have them cleared when switching tabs.  One answer is to build something like this:

           

          LOAD * INLINE [
          ExcludeO,S_flag
          Y,A
          Y,B
          Y,
          ];

           

          When switching out of the special tab, select 'Y' and lock ExcludeO.  When switching to the special tab, unlock ExcludeO and clear it.  The users should still be able to make selections in S_flag.  It will clear the S_flag, though, if the only selected value is O, and you go to a tab that excludes O.  But if you've selected A and O, for instance, the O selection would still be preserved, waiting for you when you went back to that tab.

           

          You wouldn't actually display the ExcludeO field anywhere, but I did in the attached example so that you can better see what's going on.

           

          I'm doing it all automatically rather than using a button, but if you want a button, that's simple enough.  Instead of executing the action when activating the special tab, execute the action when they press a button on the special tab.  Then, until they pressed the button, O would still be excluded, even on the special tab.

            • Re: Hot Button to make selection and then deselect when exiting the tab
              John Witherspoon

              Oops.  I was wrong.  If you select only O on the tab that allows it, then switch tabs, it fails to exclude it.  I guess the selection search string isn't quite the same as saying "select this value", but is just "select this value, but only if it isn't excluded".  I modified my example to use a macro instead for additional control, and selected the mode that should have included excluded values in the search, but it still didn't work.  I'm not sure if that's a bug or if I'm just confused.  Anyway, here's the example that I expected would fix the problem, but didn't.  Maybe someone else can see how to fix it.