Dataframe 1:
12345,B,C,2020-08-12,Internet
12345,B,D,2002-11-12,Mobile
12345,B,e,2003-10-12,Lap
Dataframe 2
12345
I have to join Dataframe 1 and Dataframe 2 and produce 1 row per record in the output for each record in DF2. My output should be like below,
Output:
12345,Y,Y,2002-11-12,Mobile
Conditions for columns,
Col 1 - Distinct value
Col 2 - If ALL values in col2 of DF1 == 'B', then populate 'Y' in output else 'N'
Col 3 - If ANY value in col3 of DF1 == 'C', then populate 'Y' in output else 'N'
Col 4 - Take Min date from col4 of DF1
Col 5 - Populate the value corresponding to Min date from Col 5 of DF1
How to achieve this?