Skip to main content
Solved

Identify duplicate attributes and only keep attribute with the most recent date.


ngstoke
Contributor
Forum|alt.badge.img+1

Hello,

I don't know the best way to go about this, I've been trying to set some conditional statements in my AttributeManager but I'm unable to get the results I'm after.

I'd like to identify the duplicate serial numbers (API NUMBER 10) in my data and then only keep the duplicate that has the most recent date (WELL STATUS DATE).

Thanks in advance for your help.

Best answer by ciarab

If you put the data through a sorter and order by your date attribute descending and then use the duplicate filter you should be left with the most recent date coming through the unique port

View original
Did this help you find an answer to your question?

3 replies

ciarab
Contributor
Forum|alt.badge.img+9
  • Contributor
  • Best Answer
  • May 16, 2017

If you put the data through a sorter and order by your date attribute descending and then use the duplicate filter you should be left with the most recent date coming through the unique port


ngstoke
Contributor
Forum|alt.badge.img+1
  • Author
  • Contributor
  • May 16, 2017
ciarab wrote:

If you put the data through a sorter and order by your date attribute descending and then use the duplicate filter you should be left with the most recent date coming through the unique port

Thank you @ciarab.

 


takashi
Influencer
  • May 20, 2017

Hi @ngstoke, you also have other choices. Assuming that the records have been originally sorted by API_NUM_10 and WELL_STATE_DATE ascending.

1. AttributeCreator + Tester

0684Q00000ArLPaQAN.png

2. Aggregator + ListIndexer

 

0684Q00000ArLO9QAN.png

3. The InlineQuerier could also be used even if the source records have not been sorted.SQL Query Example:
select a.*
from InputTable as a
inner join (select API_NUM_10, max(WELL_STATUS_DATE) as maxDate
    from InputTable group by API_NUM_10) as b
on a.API_NUM_10 = b.API_NUM_10 and a.WELL_STATUS_DATE = b.maxDate
order by a.API_NUM_10

Cookie policy

We use cookies to enhance and personalize your experience. If you accept you agree to our full cookie policy. Learn more about our cookies.

 
Cookie settings