Knowledge Drop

Use Table Calculations to Get Most Recent Line Item When User Has Duplicate Rows (Non-subquery version)

  • 7 July 2021
  • 0 replies
  • 48 views

Userlevel 4
Badge

Last tested: Mar 19, 2020
 

If you have line items in a table with duplicate ids, but only wants the most recent items or highest items many times you will try to use a SQL subquery to SELECT MAX(DATE) for the given parameter, but you can create this with table calculations in an explore.

First, sort the explore by the ID. Then, apply a secondary sort to the date column (descending).

Then, we can create a table calculation that checks if the value below the id is a duplicate.

EMAIL_DUPLICATES.png

Then, we check the date column for duplicates.
DATE_DUPLICATES.png


 

 

This content is subject to limited support.                

 

 


0 replies

Be the first to reply!

Reply