I've got a nested repeat, and am trying to create an index on the inner repeat that rolls over from the previous outer repeat. (see table below) I've got a field ${repindex} using position(..) within the inner repeat, a field (${currMax}) equal to max(${repindex}) in the outer repeat, then a sum(${currMax}) outside the repeats, which is then referenced in the display of the inner repeat. It doesn't quite work as intended, especially when I cycle back to previous repeats. Any ideas?
i.e.
| Outer repeat Value | Inner Repeat Value | rollover index |
| a | 4 | 1 |
| a | 2 | 2 |
| a | 6 | 3 |
| b | 3 | 4 |
| b | 2 | 5 |
| c | 1 | 6 |
| c | 7 | 7 |
| c | 8 | 8 |
Ideally, the rollover index would recalculate if a record is added or deleted in the middle.