Dear All,
I have data table that contain ID, last inspection data, and last inspection decision columns. I want to combine the last inspection data column with the last inspection decision in order to have one column (stacked) to be used in association analysis. For instance, one cluster of my data structure looks like the following:
ID Last Inspection Decision Last Inspection Data
101 PRODUCT SPECIFICATIONS DEFECT
101 CGMP Deviations
101 21 CFR 211.113
101 VAI LIQ_US
I would like to move Last Inspection Decision, in this case VAI, under Last Inspection Data column and create new row that has the same ID, in this case 101. Therefore I need my stacked data to be like:
ID Last Inspection Data
101 PRODUCT SPECIFICATIONS DEFECT
101 CGMP Deviations
101 21 CFR 211.113
101 LIQ_US
101 VAI
Moreover, some of these IDs are repeated but with different value in one or more of the Last Inspection Data. For instance, Lab DEFECT can be another problem for the same ID so I create another cluster of rows when ever any of these values differ from previous one.
ID Last Inspection Decision Last Inspection Data
101 Lab DEFECT
101 CGMP Deviations
101 21 CFR 211.113
101 VAI LIQ_US
Thank you very much for your help in advance.
Best,
Qais