How to correctly use group by in Google Query by one column when I multiselect columns?

24 views Asked by At

I have a page in google spreadsheet which contain list of ID's which are used in another page to be a lookup index. Initially I just used VLOOKUP and HLOOKUP functions but now I'm trying to make a Query because it offers more features to represent my data.

Simpler variant of query works fine:

=QUERY('Page1'!A3:N;"select E,sum(B) where A matches "*someID*" and E <> '' group by E";1)

Trying to get more columns I've modified string to that:

(This query works but don't do what I want)

=QUERY('Page1'!A3:N;"select E,H,sum(B),I,J,N,K where A matches "*someID*" and E <> '' group by E,I,H,J,N,K order by N desc";1)

I'm trying to group the result of my query by only column E but query language doesn't allow to skip "I,H,J,N,K" columns if I use it in the select part. that columns "I,H,J,N,K" contains mostly string data, but column E is numeric

I wanna something like this and ask you, fellows to help me correct that string!

=QUERY('Page1'!A3:N;"select E,H,sum(B),I,J,N,K where A matches "*someID*" and E <> '' **group by E order by N** desc";1)

I expect to get data from a few columns aggregated by COL E as an index

0

There are 0 answers