If the customer has two profiles for EX:100 have two profiles 1 and 2 but we need to show old profile status as error and for the new one Status should shown as per table 2,(which means the profile1 has an error so we are using profile2 that we need to display in our output)
if the customer has one profile, status should shown as per table 2: