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: 
Not applicable

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.

Thanks,

Naveen.

9 Replies
Not applicable
Author

would locking the fields help?

Miguel_Angel_Baeyens

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

Not applicable
Author

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)

Thanks

Naveen

Not applicable
Author

Thanks  Miguel. I will try the book marks idea

Not applicable
Author

Hi Miguel,

your idea is good..  But after I make selections in the first sheet for Country, state and City.. i would like to have these selections remain in other sheets and clear any other selections.  In your example atleast for the first time, we need to make selections in all sheets as it clears all selections.

and also If i make changes to selections for Country, state and City fields i want them to stay across all sheets.

Thanks,

Naveen.

Not applicable
Author

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.

Michiel_QV_Fan
Specialist
Specialist

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.

Anonymous
Not applicable
Author

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)

Dilyana

yakir_manor
Contributor III
Contributor III

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