Hi All,
I would like to compare one value of a column with the rest of the values within a group.
Given the example data below : I would like to compare any AESTDT overlapped within a group of Patient and AEPT. So Patient 1234 with AEPT as THROMBOCYTOPENIA should not have overlapped AESTDT as you can see in row no. 2, the AESTDT is in between AESTDT and AEENDT of rowNo. 1 for the same patient 1234 with THROMBOCYTOPENIA as AEPT. The last two records of the below sample data also been overlapped. So i would like to find out those type of overlapped record within the Group of Patient and its AEPT.
Thanks a lot for your help.
PATIENT | AESTDTC | AEENDTC | AETERM1 | AEPT |
---|---|---|---|---|
1234 | 1-Sep-19 | 29-Sep-19 | THROMBOCYTOPENIA | THROMBOCYTOPENIA |
1234 | 20-Sep-19 | 1-Oct-19 | THROMBOCYTOPENIA | THROMBOCYTOPENIA |
1234 | 1-Dec-19 | 3-Dec-19 | THROMBOCYTOPENIA | THROMBOCYTOPENIA |
1234 | 14-Jan-14 | 27-Jan-14 | ANEMIA | ANAEMIA |
1234 | 1-Jan-18 | 5-Jan-18 | NEUTROPENIA | NEUTROPENIA |
1234 | 3-Jan-18 | 4-Jan-18 | NEUTROPENIA | NEUTROPENIA |
1234 | 4-Jan-18 | 31-Jan-18 | NEUTROPENIA | NEUTROPENIA |
1234 | 3-Jul-19 | 30-Jul-19 | NEUTROPENIA | NEUTROPENIA |
1234 | 30-Jul-19 | 30-Aug-19 | NEUTROPENIA | NEUTROPENIA |
1234 | 4-Oct-19 | 30-Oct-19 | NEUTROPENIA | NEUTROPENIA |
3134 | 17-Jan-17 | 3-Mar-17 | SWOLLEN LEFT WRIST | JOINT SWELLING |
3134 | 2-Jan-16 | 4-Jan-16 | LEG PAIN | PAIN IN EXTREMITY |
3134 | 8-Jun-19 | NA | HYPERPHOSPHATEMIA | HYPERPHOSPHATAEMIA |
3134 | 3-Aug-19 | 4-Nov-19 | NEUTROPENIA | NEUTROPENIA |
3134 | 16-Jan-20 | NA | LEUKOPENIA | LEUKOPENIA |
3134 | 25-Jan-14 | 31-Jan-14 | ANEMIA | ANAEMIA |
3134 | 16-Jan-14 | NA | WORSENING ANEMIA | ANAEMIA |
3134 | 5-Dec-19 | 30-Dec-19 | WORSENING THROMBOCYT | THROMBOCYTOPENIA |
3134 | 1-Feb-14 | 28-Feb-14 | WORSENING ANEMIA | ANAEMIA |
3134 | 4-Sep-12 | 7-Sep-12 | LEUKOPENIA | LEUKOPENIA |
3134 | 21-Aug-12 | 4-Sep-12 | LEUKOPENIA | LEUKOPENIA |