Click here to Skip to main content
15,886,873 members
Please Sign up or sign in to vote.
1.00/5 (1 vote)
I have data in dataframe in this following format:

    Row_1 AB123, 01-mar-2011, 30-mar-2011, data1, data2 
    Row_2 CD123, 01-mar-2011, 30-mar-2011, data1, data2 
    Row_3 CD123, 01-apr-2011, 30-apr-2011, data1, data2 
    Row_4 EF123, 01-nov-2011, 30-nov-2011, data1, data2

Need the final row to be:

    Row_1 AB123, 01-mar-2011,30-apr-2011,data1,data2 
    Row_2 CD123, 01-mar-2011,30-mar-2011,data1,data2
    Row_4 EF123, 01-nov-2011, 30-nov-2011,data1,data2


What I have tried:

Tried to use for loop to check each record and then use if loop to check for each condition
Posted
Updated 21-Aug-21 3:16am
Comments
Patrice T 21-Aug-21 8:49am    
Try to show your code.
Richard MacCutchan 21-Aug-21 9:26am    
You need to build a new table with only one entry for each id. For each record in the original table you would check the two dates and only store the earliest and the latest.

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900