Questions tagged [google-query-language]

Google Query Language is the part of the Google Visualization API that lets the developer perform various data manipulations with the query to the data source. This could also be used in the Google Sheets QUERY built-in function.

Google Query Language allow developers to perform various data manipulations using a syntax very similar to the SQL syntax. It's part of the and can be used in through the QUERY built-in function.

Before posting a question about the Google Query Language check the reference documentation.

1114 questions
-1
votes
1 answer

Show occurrence of strings and append cell with percentage

Trying to work out a way to auto update a Google Sheets with the percentages of a string occurrence and append the cell with that percentage. foo | bar | foo | bar | dog | cat | bar | green | dog | bar | red | blue | car | bike | car | red …
Grimlockz
  • 2,541
  • 7
  • 31
  • 38
-1
votes
1 answer

Google Sheet: Reference cell inside importhtml query

I am trying to using the following formula to import a table from ESPN: =QUERY(IMPORTHTML("http://games.espn.com/ffl/schedule?leagueId=2127","table",2),"SELECT * WHERE Col1 = "&B3&"") Basically, I only want to return rows that contain the value…
-1
votes
1 answer

Adding an empty line between 2 queries

Good day, I'm trying to add an empty line between 2 queries, to make it easier to look at and format. Here is the main…
Konata
  • 275
  • 1
  • 3
  • 14
-1
votes
3 answers

Output a normalized column with a calculated field in QUERY

In Google Spreadsheet, I have the expression: =QUERY(database; "select b,c, where a='anyone-condition' order by c desc";-1) The column a,b are strings and c is a number. How can I include in this query one calculated field, c/sum(c)?
-1
votes
2 answers

How to concatenate strings and select the same columns multiple times using Query (Google Sheets)

I am trying to generate a table for the Gantt chart. Table should have this format: https://developers.google.com/chart/interactive/docs/gallery/ganttchart#data-format So,I need task name the same like taks ID, but in Query I can't use Col1 twice (I…
Peter222
  • 154
  • 1
  • 16
-1
votes
1 answer

Specify target worksheet in structured query of Google Sheets data

I am trying to query data from one of my google spreadsheets, and I have read the docs here. My spreadsheet has two tabs/sheets. I can query data from the first sheet, but I can't figure out how to query data from the second sheet. My query url…
Niels
  • 1,366
  • 15
  • 21
-1
votes
1 answer

How can I do a where clause on an aggregated column?

How can I do a where clause on an aggregated column? Or accomplish similar behavior in Google Sheets simply? For example.. Where SUM(A) <> 0
CodeCamper
  • 6,609
  • 6
  • 44
  • 94
-1
votes
1 answer

Count of unique characteristics in duplicate rows table

My table is having duplicate rows listed based on a duplicates ID column. The duplicate rows may have one or more Characteristic columns having unique values. I am trying to get a count of which Characteristic columns in duplicate rows have unique…
-1
votes
1 answer

Query ImportRange with date and location

I currently have a file with a bunch of columns with Date in column 1 and location in column 3. I wanted to pull a specific number based on the date and location. Currently, it just keeps pulling the column header based on the query. Attached is…
-1
votes
1 answer

Sort query by column

I am trying to make a query on Google Sheets and sort the results according to the highest values on column C. The range I am doing the query on is $A$6:$O. I have tried to do it like this: =SORT(QUERY(($A$6:$O), "Select A, B, C, D,E,F,G,H,I group…
-1
votes
1 answer

SQL in Google spreadsheets, selecting multiple values of a column

I have got a Google sheets table called Purchases with various columns for different items to purchase. The first column is called Status, and it includes values like: Research, Approval, Purchasing, Shipping, Invoicing, Complete. I want to write…
Simone Romeo
  • 59
  • 3
  • 11
-1
votes
1 answer

Select average number for the latest date in Google Query

I need to calculate an average price for the latest date for every agriculture. I use this Google query to load table from Google Sheets. var queryString = encodeURIComponent("select max(A), D, avg(E) where B = 'cpt-novo' group by D"); But i get…
-1
votes
2 answers

How to make a spreadsheet formula execute every day

I have the following formula which fetches data from the same day from table UniqueLast: =IFERROR(QUERY(UniqueLast!$A$3:X;"select * where dateDiff(A, now())=0")) It runs correctly but sometimes the table where this formula is executed keeps the…
-1
votes
1 answer

How do I write a query that combines two numbers that are being separated from another query?

I am trying to use this code to return values from a certain date =query(Overview!A:G,"select B where A = date '" & text(B2, "yyyy-MM-dd") & "'") The problem is that on the other sheet I'm querying from multiple sheets and then the query above is…
-1
votes
1 answer

Can someone help explain the syntax behind this query in Google Sheets?

I recently came across this query on Google Sheets and I had a question about one of these queries: =transpose(query(settings!A2:C,"select B, C where A = '" & B4 & "'",0)) Could some explain to me this section? = '" & B4 & "'",0) I am struggling…