1
votes

I would like to return a filtered list of products to only show the latest entry for each product in the list (meaning pick the row with the MAX date for each product).

I have setup a QUERY function using the MAX(date) in the select clause, but the problem is that it is showing all values (i.e. not showing the latest entries only).

The query I have setup is:

=QUERY('SKU list'!A:C,"select max(A),B,C where A is not null group by B,C")

A sheet with sample data and query is here

The actual result is that the query is returning old and new rows, I expect the query to only return the latest rows for each product.

1

1 Answers

1
votes
={"max Date entered", "SKU", "MSRP"; 
 QUERY(ARRAYFORMULA(IFERROR(VLOOKUP(UNIQUE(B4:B), QUERY({A4:C},
 "select Col2,Col1,Col3 
  where Col1 is not null 
  order by Col2, Col1 desc", 0), {2,1,3}, 0))),
 "where Col1 is not null 
  order by Col2 
  format Col1 'dd/mm/yyyy'")}

0