Avatar

Level 4

Hi Team,

 

I want to filter out some records based on the below conditions.

example:

Input records:

customer idcustomer typeDate
1Full time01-01-2016
1Full time01-01-2018
1Full time03-01-2020
1Part Time04-01-2021
1Part Time01-01-2015
2Full time06-01-2016
2Part Time01-01-2019
3Full time08-01-2016
3Part Time12-01-2016
3Part Time10-01-2017
3Part Time18-01-2021
4Full time12-01-2016

 

Output records expected:

On first run:

customer idcustomer typeDate
1Full time01-01-2016
1Full time01-01-2018
1Full time03-01-2020

 

On second run:

customer idcustomer typeDate
1Part Time04-01-2021
1Part Time01-01-2015

 

On third run:

customer idcustomer typeDate
2Full time06-01-2016

 

Etc

 

So basically i want a filtering technique which will filter out all the records for that particular customer with same customer type.

I tried with deduplication but only the latest one or any random one is coming.

Could someone please help me in this?

 

@Manoj_Kumar_  @Jyoti_Yadav 

 

Thanks &regards

Greeshma