Hi all,
I have become stuck trying to generate a solution to the below problem. I have tried to pivot the data, and have attempted to start building a macro, but have had no luck.
I have data which has the following fields:
- Record ID (integer) (set to phonetic alphabet to avoid too many numbers)
- Current Task ID (hex code)
- Previous Task ID (also hex code)
I have shown an example of the expected input and output below.
Essentially, I am trying to group the data (as per the output for the dummy problem below) by finding matches between Current and Previous Task IDs (Previous is Null if this is the first task).
I'm stuck as there are no other identifying fields to use, and I'm not sure how to set up an iterative macro in this case. It will need to be dynamic, as the number of items per group will change. The below example in/out might help (hopefully). Happy to answer any questions, and thanks in advance!
Example Input:
| Record ID | Current ID | Previous ID |
| Alpha | 1 | [Null] |
| Bravo | 2 | 1 |
| Charlie | 3 | 2 |
| Delta | 4 | 3 |
| Echo | A | [Null] |
| Foxtrot | B | A |
| Golf | C | B |
| Hotel | X | [Null] |
Example Output (I have tried colour-coding to make this clearer):
| Group | Item | ID |
| 1 | 1st | 1 |
| 1 | 2nd | 2 |
| 1 | 3rd | 3 |
| 1 | 4th | 4 |
| 2 | 1st | A |
| 2 | 2nd | B |
| 2 | 3rd | C |
| 3 | 1st | X |