Skip to main content
Announcements
See what Drew Clarke has to say about the Qlik Talend Cloud launch! READ THE BLOG
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

Different sheet - different selection?

Is it possible to have a different selection sets on different sheets without duplicate data or fields and use set analysis? We are looking for a general solution for this issue.

1 Solution

Accepted Solutions
Anonymous
Not applicable
Author

I wouldn't call this "an issue" - selection is applied to the data, not to the sheet objects, and it is expected. You can modify this behavior by using actions which are triggerred on events "Enter sheet" and "Leave sheet". Actions can clear selections, or make selections, or call bookmarks, or run macro, etc...

View solution in original post

5 Replies
Anonymous
Not applicable
Author

I wouldn't call this "an issue" - selection is applied to the data, not to the sheet objects, and it is expected. You can modify this behavior by using actions which are triggerred on events "Enter sheet" and "Leave sheet". Actions can clear selections, or make selections, or call bookmarks, or run macro, etc...
Not applicable
Author

Thank you for you suggestions. I agree that this behaviour is exspected, but having different use cases in one applikation this behaviour could be confusing to the user. Building a seperate application is an option.

Back to your suggestion, we already managed to store current selection as bookmark when leaving the sheet. As name of the bookmark we take the ActiveDocument.GetLayout.ActiveSheetId. By activating the sheet we recall the bookmark again. Unfourtunatly while capture the activate event of the sheet ActiveDocument.GetLayout.ActiveSheetId returns the ID of the former (source) sheet not the activated sheet (target). So we didn't manage it to make it completely dynamic. I didn't found an "after event" or Property ActiveDocument.GetLayout.ActivatedSheetId. I also tryed to capture activation event of a sheet object and bind sub on that event with no sucess.

Any suggestion about that?

Thanx

Boris

Anonymous
Not applicable
Author

Boris,

Here is how I'd do this:
First, create a separate bookmark for each sheet. For example, if the sheet names are "A", "B", and "C", so there will be the bookmarks names, just for convenience.
Next, the actions will be like this:
On leave sheet "A", store current selections in bookmark "A". Similar for "B" and "C".
On enter sheet "A", recall bookmark "A".
So, if you user is moving from sheet C to sheet A, the current selection is recorded into bookmark C (by "on leave"), and the bookmark A is recalled (by "on enter") to restore the last selection made on sheet A.

Not applicable
Author

Yes, indeed this is how we tried to manage it also..

In your solution you need a macro for every single sheet, right?. What we try to do is to keep it dynamic by naming the bookmark like the sheet id. On this way we had problems to get the sheet name while restoring the bookmark, because on activate event of the sheet we get the name of the sheet you actualy leaving, no the one you like to restore... Any suggestions about that?

Anonymous
Not applicable
Author

Actually youd need two macros per sheet in my approach - one for "leave", and one for "enter".
I suggest to keep bokmark names static. Otherwise you probably need variablse to store sheet ids fo the sheets you leave or enter.