9 Replies Latest reply: Jul 20, 2015 7:10 AM by Yakir Manor RSS

    Clear all Selections except few fields

      Whenever I navigate from one sheet to another I need to clear all selections except few fields like for Ex:  My selections for Country,Sate,City should stay across the sheets and any other selections should get cleared.


      On Sheet Activate we can Trigger  an event to clear other fields except one specific field. This works for one field. How do i get it to work for multiple fields.





        • Clear all Selections except few fields

          would locking the fields help?

            • Clear all Selections except few fields

              I would like to allow user to change the selections of the fields(Country,Sate,City) in other sheets. If i lock these fields user can only select them by unlocking  them. I dont want user to go through another step of unlocking.

              I think one way to achieve this is on leave sheets event -->  trigger actions in the following order.


              1. lock Country

              2.lock state

              3. lock city

              4. clear all

              5. unlock Country

              6. Unlock State

              8. Unlock City


              Instead of triggering so many actions, can i just use one action like below

              1. Clear Other fields  ( can i specify multiple fields in this action)





            • Clear all Selections except few fields
              Miguel Angel Baeyens de Arce

              Hello Naveen,


              You can use bookmarks instead as in this thread.


              Is that what you are looking for?


              Miguel Angel Baeyens

              BI Consultant

              Comex Grupo Ibérica

              • Clear all Selections except few fields
                Tim Benoit

                Are the required selections always the same? If so, you could set up a trigger that fires when the selections are cleared. Set up actions in the trigger that re-select the required selections or re-applies a standard bookmark.

                • Clear all Selections except few fields
                  Michiel van de Goor

                  I was looking for something similar myself.


                  This is my solution:


                  On active sheet I set 3 triggers:


                  Select in field  <Year>   with the expression: =GetFieldSelections(Year)

                  Select in  field ....

                  Select in field ....

                  for each dimension I want to keep selected.


                  On exiting this sheet I wanted to keep the selections made with the exception of 1 (flag).

                  I solved this by:

                  Select in field  <flag>    with the expression left blank


                  Maybe this is your solution.

                  • Clear all Selections except few fields
                    Dilyana Ivanova

                    Hi Naveen,


                    You can use fewer actions 'on activate' only by:

                    1. lock Country

                    2. lock state

                    3. lock city

                    4. clear all

                    5. unlock all


                    This would allow changing the selections on each sheet but keeping them when changing sheets (and clearing the others)



                    • Re: Clear all Selections except few fields
                      Yakir Manor

                      even though you already got your answer i think there's a room for one more answer,



                      for me i needed 3 more things:

                      - at least one selected value

                      - no impact from space in the value

                      - no effect what so ever by 'Clear All' event



                      i also wanted a dimension with only one selected value but without using the qlikview special feature because it destroys the server bookmarks, you can remove a field with 'Always one...'  but when adding one the old bookmarks are missing it so they stop work, this is super annoying so i solved that too (:



                      you need to look in the 'File -> Edit Script' for comments, and also in the 'Tools -> Edit Module...'


                      if your using qlikview server to show data you can see that pressing the clear button keeps everything yet something is not working right, that is because there's an issue with using the Action: Actions -> Add -> Selection -> Clear All, it clears all fields without running the OnSelect event (bug?), this can be solved by doing it using macro, you can see the attached file for know how.



                      if for some reason you need to also unlock all fields ( maybe you hide all tabs and did button based navigation and you lock some dimension on each page) then change the macro function to this:


                      Sub ClearAllMacro

                        ActiveDocument.UnlockAll true

                        ActiveDocument.ClearAll true

                      End Sub