Skip to main content
Announcements
Qlik Connect 2025: 3 days of full immersion in data, analytics, and AI. May 13-15 | Orlando, FL: Learn More
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

Lock/Unlock Selection

Hello Everyone,

here goes my 1st question in QlikView forum .

is it possible to localize lock/unlock selection? let me elaborate more - if we have 2 sheets, say TEST1 and TEST2. if i am on TEST1 and do my selection on variables, i don't values changes to happen in TEST2 sheet.

i think, by default, selection is GLOBAL in QlikView.

Thanks in advance,

_Balwant

2 Replies
Not applicable
Author

There is a little confusion in your question, are you referring to Variables or Fields? If you are referring to fields then you can do the following in a macro:

ActiveDocument.Fields("YourFieldName").Lock

And to reverse it........

ActiveDocument.Fields("YourFieldName").UnLock

However, if you really are talking about Variables then you cannot lock them (as far as I am aware), but of course the content of variables is controlled by your app so you should simply avoid adding objects that allow the variable to be changed. You could create a macro that "remembers" the content of the variable and then resets it when you return to the first sheet.

Macro1 (to remember the value, can be triggered on leaving the sheet):

ActiveDocument.Variables("VariableNameToRememberVar1").SetContent ActiveDocument.Variables("Variable1").GetContent.String, true

Macro 2 (to reset the value, can be triggered on activating the sheet):

ActiveDocument.Variables("Variable1").SetContent ActiveDocument.Variables("VariableNameToRememberVar1").GetContent.String, true

Good luck,

Nigel.

johnw
Champion III
Champion III

If I understand your question, you want selections on one sheet to not affect another sheet, even though the other sheet has the same fields.

That's really not how Qlikview works. As you say, selections are global in Qlikview. But I can think of several possible solutions. First, use two sets of data with different field names for the two sheets. Second, use two different applications instead of two sheets. Third, if you don't need to make selections on the same fields on the second sheet, use set analysis to ignore the selections in the fields on the first sheet.