I am working on following dataframe.
File1:
UniqueId Match_ID Parameters Value
UID-245 xty-tt09-23-ert Age 28
UID-245 xty-tt09-23-ert Sex Male
UID-245 xty-tt09-23-ert Height 5.7
UID-245 xty-tt09-23-ert Balance 200
UID-246 xty-tt09-03-ert Balance 303
UID-246 xty-tt09-03-ert Weight 89
File2:
UniqueId Match_ID Parameters Value
UID-245 xty-tt09-23-ert Age 29
UID-245 xty-tt09-23-ert Sex Female
UID-245 xty-tt09-23-ert Height 5.7
UID-245 xty-tt09-23-ert Balance 200
UID-246 xty-tt09-03-ert Balance 300
I need to compare both the datafrme and required the following output on distinct UniqueId basis.
Where, We need to compare File1 Parameters Value with File2 to check if both are exact match or not. Also, We need to create a comma separated string of Mismatched Parameters in output dataframe as Variable_Mismatched.
UniqueID Count_File1 Count_File2 Matched_Parameters Mismatched_Parameters Variable_Mismatched
UID-245 4 4 2 2 Age,Sex
UID-246 2 1 0 1 Balance