Calculate the target column where default value is 1 but it is 0 when a group within ID1 has a Yes so for example in 9 there is one value as Yes we want to keep other No as 0
Given target col is expected answer
ID1 ID2 Match target
4 A10 Yes 1
4 A20 No 0
5 A30 Yes 1
6 A50 No 1
6 A60 No 1
7 A70 Yes 1
8 A60 No 1
9 A30 Yes 1
9 A20 No 0
9 A10 No 0