Query placement and how to move queries in Google Sheets

This guide covers how Supermetrics for Google Sheets inserts queries into the cells, and how to move queries after they have been created.


Quick links to sections below:


Behavior on initial query creation

When a query configuration is run for the first time, the start point of the data will be in the cell that is selected when the query is run from the Get Data to Table button.


In this example, this new query will begin to be added at cell B2 in Sheet4 and fill out to the right and below from there, based on the size and depth of the data.

This then translates to the query configuration being added into the SupermetricsQueries sheet. The sheet is hidden by default – open it from Add-ons → Supermetrics → Manage queries or by clicking on it in the All Sheets menu:

In the SupermetricsQueries sheet you can now find the query configuration with the sheet reference and the cell range that the data resides in. The range address will change on later refreshes if the size of the data changes.


How to move existing queries within the same sheet

Once a query has already been created, there are two ways to move it around in the same file.


Method #1 - The drag-and-drop

This method works best for smaller queries that you just need to re-position within the same tab.

  1. Find the query data you want to relocate in your Sheet.
  2. Highlight all cells that are part of that query.
  3. Hover over the edge of the selection until you see the hand-icon.
  4. Drag it into the new position, and drop it.
  5. The range address for this query will update automatically in the configuration. Future refreshes will add it to the new location.

GIF showing the drag-and-drop technique to move a query to a new location


Method #2 - Manually editing the configuration

This method works best for very large queries that need to be moved either within the same tab or moved to another tab in the same sheet file.

  1. Open the SupermetricsQueries tab.
  2. Find the row that has the query you wish to move. In this example, we want to move this query in row 22 to another location:

  3. In that row, delete the Query ID and Sheet name values (columns A and D).
    In Range address (column E), delete the existing formula/value, and fill in the new sheet and range address for the query.
    In this example, the new location for the query is a sheet with the name "movehere" and the range address starts from cell B2.Note that it's more important to have the right start cell in the range than the right end cell - if you mess it up, it will be overwritten correctly to match the whole size of the query.
  4. Move the cursor away from the row being edited so it does not lock the cells.
  5. Refresh all queries from Add-ons → Supermetrics → Refresh all or from the Supermetrics sidebar button Refresh all queries:
  6. This will refresh the query into the new location, and update the deleted columns to have a new Query ID and Sheet name, as set in the Range address cell.
    Note that in this example the range's end value has been automatically corrected from C80 to D81, to match the actual data size.
  7. This scenario will usually delete the data in the original location, but double-check this has been done after the query has refreshed. If the data was not removed in the original location, delete it manually to clean it up.


How to move existing queries to another Google Sheets file

These instructions can be used you need to relocate a query to another file or copy the query to reuse it.

  1. Open the SupermetricsQueries tab in the file you will be copying the query from.
  2. Find the row that has the query you wish to move. In this example, we want to move this query in row 22 to another file:

  3. Copy the whole row of data.
  4. Open the new file you wish to copy the query into.
    • If the new sheet file has never used Supermetrics before, please click on Add-ons → Supermetrics → Launch to initialize the add-on, and have it generate the SupermetricsQueries tab needed for the next steps.
  5. Open the SupermetricsQueries tab in the destination file (Add-ons → Supermetrics → Manage queries).
  6. Paste the copied query row with Paste values only into the next available row under the header (if a new file, always copy into row 21 to start).
  7. In the row where you pasted the query row, delete the Query ID and Sheet name values (columns A and D).
  8. In Range address (column 4), fill in the value for the new sheet and range address for the query. Make sure the sheet name exists in this new destination file, and that the range address matches where you want the data to populate (In this example, Sheet1, starting from cell A2).
  9. Move the cursor away from the row being edited so it does not lock the cells.
  10. Click Add-ons → Supermetrics → Refresh all.
  11. This will refresh the query into the new location, and update the deleted columns to have a new Query ID and Sheet name, as set in the Range address cell.

  12. If this was to relocate the query, now delete the row for the query in the original file and delete the data in the original location.




Did you find it helpful? Yes No

Send feedback
Sorry we couldn't be helpful. Help us improve this article with your feedback.