I have this data set:
| ID | HOH |
| 903 | 1 |
| AB4 | 0 |
| 26A | 0 |
| E52 | 1 |
| 53D | 0 |
| 40 | 0 |
| 7B6 | 0 |
| E8D | 1 |
| A80 | 0 |
| AA6 | 0 |
| 63A | 1 |
| 3DB | 0 |
| A57 | 0 |
| D27 | 0 |
| 450 | 0 |
| F4D | 0 |
| 0A2 | 0 |
| 37F | 1 |
| E52 | 1 |
| 282 | 1 |
| 268 | 1 |
The IDs are individuals and HOH = 1 is the head of household for the next records with HOH = 0. Then the next HOH = 1 start the next household group. I need to group those like this:
| ID | HOH | Household |
| 903 | 1 | 903 |
| AB4 | 0 | 903 |
| 26A | 0 | 903 |
| E52 | 1 | E52 |
| 53D | 0 | E52 |
| 40 | 0 | E52 |
| 7B6 | 0 | E52 |
| E8D | 1 | E8D |
| A80 | 0 | E8D |
| AA6 | 0 | E8D |
| 63A | 1 | 63A |
| 3DB | 0 | 63A |
| A57 | 0 | 63A |
| D27 | 0 | 63A |
| 450 | 0 | 63A |
| F4D | 0 | 63A |
| 0A2 | 0 | 63A |
| 37F | 1 | 37F |
| E52 | 1 | E52 |
| 282 | 1 | 282 |
| 268 | 1 | 268 |
So create groups where groups do not exist. The file comes sorted so the first HOH = 1 and HOHs = 0 are in the same household.
Thanks