merge codes and concat values when de-duping encounters