Forum

Removing Rows with ...
 
Notifications
Clear all

Removing Rows with the same ID, Keep the latest entry

6 Posts
3 Users
0 Reactions
184 Views
(@gsasser)
Posts: 6
Active Member
Topic starter
 

Hello, I have a data table that needs to be updated daily with new entries containing duplicate IDs within the ID column. I am looking for a solution to remove the previous rows that match the new entry based on the ID number while keeping the latest entry intact. I have tried to come up with a solution but need help. Could you please provide me with the necessary Mcode or guidance to help me create this process? Thank you.

 
Posted : 05/05/2023 9:45 am
Riny van Eekelen
(@riny)
Posts: 1195
Member Moderator
 

Could you please upload a file with some sample data that resembles your real situation? It's so much easier to help with some real data to work with.

 
Posted : 05/05/2023 10:05 am
(@gsasser)
Posts: 6
Active Member
Topic starter
 

My apologies. I appreciate your help. I have attached a sample data file.

 
Posted : 05/05/2023 10:32 am
Alan Sidman
(@alansidman)
Posts: 223
Member Moderator
 

How do you identify the latest entry.  The only dates I see are listing and closing dates.  Am I missing something?

 
Posted : 05/05/2023 11:28 am
(@gsasser)
Posts: 6
Active Member
Topic starter
 

As new data is added, it is appended. I am a newbie here. My thought was to add an index column as one of the first steps. I don't know, really. Maybe I need to add a date column to the raw data before loading it to power query? 

The CDOM (Cumulative Days on Market) column may be the best resource for identifying the latest entry unless there were multiple changes to an MLSNumber on the same day. I really don't know what the best practice is.

Your guidance is appreciated!

 
Posted : 05/05/2023 11:57 am
Alan Sidman
(@alansidman)
Posts: 223
Member Moderator
 

In my mind the best method would be a date time field that indicates the updates. Then the latest record can be maintained and any earlier records removed.  Update your workbook to indicate same and we can then provide a functional solution.

 
Posted : 05/05/2023 6:34 pm
Share: