0
votes

If I import the complete data from one sheet using query("importrange-link","select *",5) and using query formula =query(Sheet1!B1:H23,"select B,C,COUNT(H) GROUP BY B,C",5) and getting results correctly.

Instead of importing and then using query. I want to use query,importrange- =QUERY(importrange("https://docs.google.com/spreadsheets/d/1VKsu1xr_2_rYuqS0VYrk6nXaJO7u_5orq-rmXDxtpGQ/edit#gid=902063099","Sheet3!B:H"), "select col3,col2,count(8) group by col3,col2",5)

getting the following error:

"Error Unable to parse query string for Function QUERY parameter 2: PARSE_ERROR: Encountered " "8 "" at line 1, column 24. Was expecting one of: "min" ... "max" ... "avg" ... "count" ... "sum" ... "no_values" ... "no_format" ... "is" ... "null" ... "year" ... "month" ... "day" ... "hour" ... "minute" ... "second" ... "millisecond" ... "with" ... "contains" ... "starts" ... "ends" ... "matches" ... "like" ... "now" ... "dateDiff" ... "quarter" ... "lower" ... "upper" ... "dayOfWeek" ... "toDate" ... ... .."

Gsheet: https://docs.google.com/spreadsheets/d/1jBdWoZIUADgZYy_KdpOtvzx4el3I44t-KwoW83muXSc/edit#gid=411230829

2

2 Answers

0
votes

There are syntax/typographical errors.

Instead of col1 (all lower case) use Col1 (title, first letter uppercase, the rest lower case).

Related

1
votes

Try the following formula:

=QUERY(importrange("https://docs.google.com/spreadsheets/d/1VKsu1xr_2_rYuqS0VYrk6nXaJO7u_5orq-rmXDxtpGQ/edit#gid=902063099","Sheet3!A:H"), "select Col2,Col3,Count(Col8) group by Col3,Col2")