This site uses different types of cookies, including analytics and functional cookies (its own and from other sites). To change your cookie settings or find out more, click here. If you continue browsing our website, you accept these cookies.
I have a query and I may get up to 3 different records returned with 3 different dates. Is there a way I can limit my results to 1 record with the latest date? Thank you for any help you can provide.
you can always limit the amount of records within the workflow. Add a sort tool with the date on descending order and a sample tool contains the first 1st row.
Let me know if that works for you
Hi @jhouseslu, you could use @VianneyM's approach to do the filtering/sampling in Alteryx, or maybe attempt to do so in the source SQL itself. Something like:
DATE = (SELECT MAX(DATE) FROM TABLE_NAME)
Hi @jhouseslu ,
if you are looking for a solution using only SQL, you could try:
SELECT *FROM MyTable AS aJOIN(SELECT IdColumn, MAX(Date) AS MaxDateFROM MyTableGROUP BY IdColumn) AS bONa.Date = b.MaxDateANDa.IdColumn = b.IdColumn