In the image below I would like to keep the "Sub Section X" counter from resetting when a new "Master Section" (group 1) is inserted.
Ideally, the form will appear as such when the counting is being performed correctly:
I have found that referencing a counter outside of the repeating group (say count(//group2)) and unchecking "refresh value when formula is recalculated" proves to be unreliable.
Here is the XPath for each node:
Group1Count: count(../preceding-sibling::*) + 1
Group1Label: concat("Master Section ", ../my:Group1Count)
Group2Count: count(../preceding-sibling::*) - 1
Group2Label: concat("Sub Section ", ../my:Group2Count)