Do not input private or sensitive data. View Qlik Privacy & Cookie Policy.
Skip to main content

Announcements
Join us to spark ideas for how to put the latest capabilities into action. Register here!
cancel
Showing results for 
Search instead for 
Did you mean: 
Anonymous
Not applicable

Clear selection on single sheet - possible?

Hi,

I have 5 sheets.  Every time the user goes to sheet 1, I want to clear all the selection on this sheet only

and leaving the other sheets unaffected.  Is this possible?  When I setup a trigger on sheet 1 and chose "Clear All", it

cleared the selections on all the sheets which isn't what  I want to do.

Thanks

1 Solution

Accepted Solutions
Anonymous
Not applicable
Author

Anil,

I tested out your snippet.  It turns out your code will clear all sections not just one object, ex: CH01.

I looked further into the QV API and found the solution and this works for me.  All I need is to execute one

of these lines.  First one clears everything but "year".  Second clears "year" only.

     ActiveDocument.Fields("year").ClearAllButThis

     ActiveDocument.Fields("year").Clear

Thought I post this back.

Thanks

View solution in original post

4 Replies
MarcoWedel

use Alternate States

hope this helps

regards

Marco

Anil_Babu_Samineni

I am not sure, There is direct way. But you can try Sheet activated  with Clear All action

OR

By using macro, you may can try this

Sub RemoveOnlyOneSelected

     Set QvObj=Activedocument.GetSheetObject("CH01")

     Set A=QvObj.GetField

     Set FieldProp=A.GetProperties

     FieldProp.OneAndOnlyOne=False

     A.SetProperties FieldProp

     ActiveDocument.ClearAll True

End Sub

Best Anil, When applicable please mark the correct/appropriate replies as "solution" (you can mark up to 3 "solutions". Please LIKE threads if the provided solution is helpful
Anonymous
Not applicable
Author

Anil,

If I'm reading your code correctly, that looks like it's for a specific object.  How do you operate on sheet level?  I don't see sheet being an object when I looked at document properties.

Anonymous
Not applicable
Author

Anil,

I tested out your snippet.  It turns out your code will clear all sections not just one object, ex: CH01.

I looked further into the QV API and found the solution and this works for me.  All I need is to execute one

of these lines.  First one clears everything but "year".  Second clears "year" only.

     ActiveDocument.Fields("year").ClearAllButThis

     ActiveDocument.Fields("year").Clear

Thought I post this back.

Thanks