I have a spreadsheet1
with the following columns:
name, country, value
In another spreadsheet2
I'd like to have set of clickable links based on parameters:
param1, param2, link
where:
-
link
opens a new, filtered view ofspreadsheet1
, based on params fromspreadsheet2
something like:spreadsheet1 where name=param1 and country=param2
How can I achieve this in Google Spreadsheet? I know nothing about scripts yet.
Best Answer
As I mentioned in comments, this can't be done as you wanted because of the lack of programmatic access to filtered views (until this request gets implemented).
So I wrote a script that does something along the lines that you wanted, but using the show/hide columns functionality. To simplify things, I am assuming that the data and the parameters are in different sheets of the same spreadsheet.
For example, suppose the first sheet of your spreadsheet is
and the second sheet has
Instead of placing links in the second sheet, I opted for a simpler (for me) approach, a custom menu option:
To use this:
You should see the first sheet filtered by the desired parameters:
To go back to seeing all rows, use the menu command "Show all".
Here is the script that does all of this: copy-paste it to
Tools->Script Editor
(erasing the placeholder there). After saving it, you will need to close and reopen the spreadsheet to have the custom menu option appear.