I am working with survey response file in which I need to remove duplicate entries based on the following logic: