Run queries
A query is the request that fills a sheet. It says which data to get from your connections and where to put it in your spreadsheet.
Before you start
Make sure that you:
- Installed the Two Minute Reports add-on in your spreadsheet
- Created at least one connection in Connections
Create a query
Open Data Queries
In the Two Minute Reports sidebar, select Menu at the top left, then select Data Queries. Select Add.
Name your query
In Name, type a name that tells you what the query gets. For example, "Facebook Ads - November 2024" or "Google Analytics - Traffic".
Select a connection and accounts
In Use (Connection), select the connection. Then select one or more accounts from that connection.
Choose metrics and dimensions
- Metrics are the numbers that you measure, such as clicks, impressions, revenue, or conversions.
- Dimensions (Group by) split those numbers, such as by campaign, date, or platform.
Each connector has its own metrics and dimensions.
Set the date range
In Date, select the time period. You can select:
- A preset range, such as Last 7 days, Last 30 days, or Last 3 months
- A rolling range, such as Last N days
- A custom range, or a range read from cells in your sheet. See Dynamic date range from cells.
Most ranges move forward on their own. See Date ranges that move forward.
Add filters and sort order
This step is optional. Open Filters to narrow the data, for example "Campaign contains 'Brand'". Open Sort to order the rows by a metric or dimension.
A filter can use a field that is not one of your columns. The field selects the rows, but it does not go into the sheet. See Filter by a field that is not in your report.
Run the query
Select Run query. The add-on saves the query, gets the data, and writes it to the sheet and cell that you set in Save on Sheet.
Query results
After the query runs:
- The data appears in your sheet as a table.
- You can format the data with Google Sheets tools, such as colors, fonts, and charts.
- Each time that you run the query again, it gets the data again.
Date ranges that move forward
Custom Range and Custom Range (Cell reference) use the dates that you set. Custom Range (Dynamic End Date) keeps the start date that you set. Its end date is Today or Yesterday, so the range gets longer each day.
The add-on calculates all the other ranges in Date from the day of the run. Each time that the query runs, the add-on calculates the start date and the end date again. You do not edit the query to move the dates.
"Today" is the date in the time zone of the query. The time zone is the grey text to the right of the Date label, for example "Team Default". To change it, select that text or the globe icon next to it, then select a time zone in Timezone.
The sheet gets the new dates only when the query runs. To update the data automatically, schedule a refresh.
What the Last N ranges include
| Date | Options | Start date | End date |
|---|---|---|---|
| Last N days | Including Today off | N days before today | Yesterday |
| Last N days | Including Today on | N days before today | Today |
| Last N weeks (mon-sun) | Including this week off | The Monday of the week N weeks before this week | The Sunday of last week |
| Last N weeks (mon-sun) | Including this week on | The Monday of the week N weeks before this week | Today |
| Last N weeks (sun-sat) | Including this week off | The Sunday of the week N weeks before this week | The Saturday of last week |
| Last N weeks (sun-sat) | Including this week on | The Sunday of the week N weeks before this week | Today |
| Last N months | Including this month off | The first day of the month N months before this month | The last day of last month |
| Last N months | Including this month on, Including Today off | The first day of the month N months before this month | Yesterday |
| Last N months | Including this month on, Including Today on | The first day of the month N months before this month | Today |
The maximum for N is 1096 days, 104 weeks, or 36 months.
Some platforms keep data for a limited time only. See Get all the historical data.
Tips for queries
- Keep queries focused. Get only the metrics and dimensions that you need. Large queries make large, slow sheets.
- Use clear names. A clear name helps you find the query months later.
- Check your filters. Make sure that the filters give the result that you expect before you schedule the query.
- Use several small queries. Several focused queries are often faster and easier to read than one large query.
Copy queries to a new spreadsheet
You can copy all the sheets and queries in a spreadsheet to a new spreadsheet, and pick different accounts for the copy. This is useful when you make the same report for several clients. See Copy a spreadsheet.
Get all the historical data (Long time)
To get all the data that an account has, select Long time in Date. In most queries, the list shows its dates next to it, from January 1, 2015 to today. The end date is today, and it moves forward each day.
For most connectors, Long time asks for all the data from January 1, 2015 to today. The connectors in the table below start later. The sheet does not always start on the first day that Long time asks for:
- The account has no older data. The first row is the first day with data, for example the day that the account started to show ads.
- The platform keeps data for a limited time only. The platform does not give data that is older than its limit.
These connectors get less history:
| Connector | The oldest data that you can get |
|---|---|
| Facebook Ads | About the last 36 months |
| Microsoft Ads | The last 36 months |
| Google Search Console | The last 16 months |
| Facebook Insights, Instagram Insights, LinkedIn Pages | The last 2 years. Long time starts 2 years before today. |
| Google Ad Manager | The last 3 years. Long time starts 3 years before today. |
| LinkedIn Ads | January 1, 2017 |
| TikTok Ads | January 1, 2019 |
Common issues
If your query returns no data or unexpected data, check that:
- The account has data for the date range
- The connection still has access to the account
- Your filters do not remove all the rows
- The date range is correct for the connector. Some platforms keep data for a limited time only. See Get all the historical data.
If the problem continues, contact support.
Next steps
- Schedule refreshes: keep your data up to date
- Manage your spreadsheets: find and copy the spreadsheets that use the add-on