Hi everyone
I have a table with thousands of records listing pt id, start date, end date, event id where records were incorrectly coded with different event ids for events that were actually one continuous event and that should therefore have an aggregate event id.
I need to group them by pt id and create a chronological sequence of events where for the same pt id the start date of the subsequent event equals the end date of the previous event (there could be some that stand alone, there could be pairs or up to a sequence of 5 or 6)
what would I need to write to generate that sequence (1st, 2nd, 3rd) and to then group them into a new field called true event id that groups all the previously different events that we've now established are part of a sequence?
many, many thanks in advance!Cheers
I have a table with thousands of records listing pt id, start date, end date, event id where records were incorrectly coded with different event ids for events that were actually one continuous event and that should therefore have an aggregate event id.
I need to group them by pt id and create a chronological sequence of events where for the same pt id the start date of the subsequent event equals the end date of the previous event (there could be some that stand alone, there could be pairs or up to a sequence of 5 or 6)
what would I need to write to generate that sequence (1st, 2nd, 3rd) and to then group them into a new field called true event id that groups all the previously different events that we've now established are part of a sequence?
many, many thanks in advance!Cheers