This is the given data
Company_NO Hierarchy_1 Hierarchy_2
1234 Insurance A
1234 Insurance A
1234 Auto B
5678 Claims B
5678 Claims B
5678 New C
In the above table, the column hierarchy_2 has three distinct values A,B,C. In the above example, for company_no=1234, since there is no row for hierarchy_2='C', that row should still appear. That is company_no=1234, hierarchy_1='NA', hierarchy_2='C'
Expected Output:
Company_NO Hierarchy_1 Hierarchy_2
1234 Insurance A
1234 Insurance A
1234 Auto B
1234 NA C
5678 Claims B
5678 Claims B
5678 New C
5678 NA A
As you can see above, an extra row is added with hierarchy_1='NA' whenever there is an empty row. Please help! Thank you!