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

Announcements
See why IDC MarketScape names Qlik a 2025 Leader! Read more
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

How to open a sheet based in clicking in a value of a pivot table

Hi,

I would like to know how to open a determinated sheet based of the column or expression I click in a pivot table. The expression can be a formula.

I´m using a macro

Sub openDetalle
ActiveDocument.Sheets("A").Activate
End sub

but I don´t know how to open the sheet based in the column I click

For example:

error loading image

1 Solution

Accepted Solutions
Not applicable
Author

Hi, see attached qvw file.

The title is a vertical dimension, there are 2 macros, opensheet and openIntro.

The macro opensheet is executed when field title or filed index is selected. See Document properties

View solution in original post

8 Replies
Not applicable
Author

is it possibe?

Not applicable
Author

It depends on if you have other selections or not. When you click on a field in a Pivot Table, it makes a selection.

To determine which item was clicked on in the pivot table, you would need to look at what selection was made. There are probably multiple ways to go about it, but comparing the current selection with a variable that held the previous selection would be how I would approach it.

The other problem is that selections made elsewhere in the document would also go through this same macro. There is no way to determine if the selection was made on the pivot table or somewhere else in the document. You could use a completely separate set of data and only use it on the pivot table, but that may get a little messy.

There really isn't a nice, easy way to do this, but if you really need that functionality, it can probably be done.

Not applicable
Author

Everytime i click on in the pivot table, i obtain the same selection of year, week and day.

This is the reason i can´t to compare the current selection with the column I click.

I need to obtain the number of column tha i click and then open the sheet via macro

rwunderlich
Partner Ambassador/MVP
Partner Ambassador/MVP

What version of QV?

Can you post a sample QVW?

-Rob

Not applicable
Author

Hi Rob, i have solved my problem, how can i attach a qvw file with an example?

I can´t do it, i don´t find the button to attach files to this post

Not applicable
Author

Click on "Quick Reply" then their is a film icon looking thing on the tool bar. Click it, it says media but includes qvw's

Not applicable
Author

Also, if you're doing a regular reply, there are tabs at the top. Click the Options tab and you have the option to Attach a file.

Not applicable
Author

Hi, see attached qvw file.

The title is a vertical dimension, there are 2 macros, opensheet and openIntro.

The macro opensheet is executed when field title or filed index is selected. See Document properties