问题
I am trying to use the QUERY function on a list of Google Form responses to only display the most recent of unique entries(based on the key Student ID).
A = Timestamp Column
C = Student ID Column
Using:
select max(A)
group by C
I was able to get the right entries, but only one column for each(I want all the data, the whole row, from the right entries)
So I tried using:
select max(A),B,C,D,E,F,G,H
group by C
But this gives an error
Unable to parse query string for Function QUERY parameter 2: ADD_COL_TO_GROUP_BY_OR_AGGB
I am new to databases, first time using QUERY. Sorry if this is confusing, but maybe the sheet makes more sense: spreadsheet
回答1:
In addition to Chris' contribution and using QUERY():
=ArrayFormula(vlookup(query({row(Raw!A:A),sort(Raw!A:J)},
"select max(Col1) where Col4 is not null group by Col4 label max(Col1)''",0),
{row(Raw!A:A),sort(Raw!A:J)},{2,3,4,5,6,7,8,9,10,11},1))
回答2:
Does this formula work as you want:
={Raw!A1:J1;FILTER(Raw!A2:J,MMULT((Raw!C2:C=TRANSPOSE(Raw!C2:C))*(Raw!A2:A<TRANSPOSE(Raw!A2:A)),SIGN(ROW(Raw!A2:A)))=0)}
来源:https://stackoverflow.com/questions/31632986/google-sheets-query-most-recent-unique-entries