Qlik Community

QlikView App Dev

Discussion Board for collaboration related to QlikView App Development.

cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

Clear all selections removes the logic

Hello,

I have a data set that I derive from a view after applying some logic to it.

Whenever a user clicks on the clear all selections button (not the clear button), that data set is lost and it immediately shows the entire data from the view. Is there a way to set a bookmark on the clear all selections button or is there a way to remove the button entirely?

I also tried writing a macro but that only affected the clear button and whenever the user clicks on the clear all selections button it reverts back to showing the entire data from the view.

Thanks.

Message was edited by: Rahul Nandipati

1 Solution

Accepted Solutions
atkinsow
Specialist II
Specialist II

You'll need to determine your bookmark id first.  To do that, go to the Bookmarks menu and select 'More'.

This should show you a list of all your document bookmarks.  There will be an ID column for each bookmark.  Make note of the bookmark that you want as the default clear value.  I'm going to assume it is BM01 for this.

Cancel out of that.

Then go to the Settings >> Document Properties menu. 

Select the 'Triggers' tab.

In the Document Event Triggers, click on 'OnAnySelect'.  Then click on the 'Add Action(s)' button.

Click 'Add' to add an action.

Click on Action Type of 'Bookmark'.

Select 'Apply Bookmark'

Click 'Ok'.

In the 'Bookmark ID' field enter this formula

=if(isnull(GetCurrentSelections()),'BM01',)

Replace BM01 in the formula with whatever your bookmark id is.

View solution in original post

10 Replies
rodjager
Partner
Partner

Hi Rahul,

Try setting the Clear State.  To do this:

1. Make your default selections

2. Select Selections > Set Clear State

When a user clicks the Clear button the default selections will return to what has been set against the Clear State.

Note this will apply to the whole QlikView document.

Hope this helps.

Rod

Digvijay_Singh

'clear all' clears even the clear state. The workaround of removing button temporarily can be done by dragging option from menu to customize window.

Capture.PNG

Not applicable
Author

This Allows me to customize a toolbar. But, even then a user can right click on the screen and click on clear all selections which also goes past the clear state of the clear button.

Currently, I don't have a clear all button on my toolbar, but still the user can right click on the screen and do clear all selections. Is there a way to remove the clear all selections option or is there a workaround like attaching a boookmark to action "when clear all selection button is clicked".

Thanks

Not applicable
Author

Hello Rod,

I have already set the clear state on the clear button.

I wanted to do the same with the clear all/clear all selections button.

Thanks

Digvijay_Singh

We cannot deactivate right click. I think one way could be adopted is to create a button and trigger your bookmark from the button action. This way even accidentally user clicks on right click clear all, they can quickly revert to book mark view by button clicking if they accidentally hit clear all.

atkinsow
Specialist II
Specialist II

I would think you would apply a trigger at document level to apply the bookmark when getcurrentselections is null.

Not applicable
Author

The clear button already does that as i have set a bookmark for that, but i don't want any user to be able to see the data that they are when they click clear all selections.

Not applicable
Author

Can you elaborate? are you saying i should assign a macro to that trigger? I am fairly new so i do not have much idea about it.

atkinsow
Specialist II
Specialist II

You'll need to determine your bookmark id first.  To do that, go to the Bookmarks menu and select 'More'.

This should show you a list of all your document bookmarks.  There will be an ID column for each bookmark.  Make note of the bookmark that you want as the default clear value.  I'm going to assume it is BM01 for this.

Cancel out of that.

Then go to the Settings >> Document Properties menu. 

Select the 'Triggers' tab.

In the Document Event Triggers, click on 'OnAnySelect'.  Then click on the 'Add Action(s)' button.

Click 'Add' to add an action.

Click on Action Type of 'Bookmark'.

Select 'Apply Bookmark'

Click 'Ok'.

In the 'Bookmark ID' field enter this formula

=if(isnull(GetCurrentSelections()),'BM01',)

Replace BM01 in the formula with whatever your bookmark id is.